Message from discussion
Easy improvement at Save() method
Received: by 10.236.175.225 with SMTP id z61mr13430525yhl.9.1322754338997;
Thu, 01 Dec 2011 07:45:38 -0800 (PST)
X-BeenThere: php-object-generator@googlegroups.com
Received: by 10.150.204.7 with SMTP id b7ls11618312ybg.1.gmail; Thu, 01 Dec
2011 07:45:37 -0800 (PST)
Received: by 10.101.129.30 with SMTP id g30mr2231255ann.7.1322754337147;
Thu, 01 Dec 2011 07:45:37 -0800 (PST)
Received: by 10.101.129.30 with SMTP id g30mr2231253ann.7.1322754337131;
Thu, 01 Dec 2011 07:45:37 -0800 (PST)
Return-Path: <joel...@gmail.com>
Received: from mail-gy0-f185.google.com (mail-gy0-f185.google.com [209.85.160.185])
by gmr-mx.google.com with ESMTPS id e12si2297674yba.3.2011.12.01.07.45.37
(version=TLSv1/SSLv3 cipher=OTHER);
Thu, 01 Dec 2011 07:45:37 -0800 (PST)
Received-SPF: pass (google.com: domain of joel...@gmail.com designates 209.85.160.185 as permitted sender) client-ip=209.85.160.185;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joel...@gmail.com designates 209.85.160.185 as permitted sender) smtp.mail=joel...@gmail.com
Received: by ghbg15 with SMTP id g15so1907779ghb.22
for <php-object-generator@googlegroups.com>; Thu, 01 Dec 2011 07:45:37 -0800 (PST)
MIME-Version: 1.0
Received: by 10.236.77.98 with SMTP id c62mr3539250yhe.5.1322754337072; Thu,
01 Dec 2011 07:45:37 -0800 (PST)
Received: by l24g2000yqm.googlegroups.com with HTTP; Thu, 1 Dec 2011 07:45:37
-0800 (PST)
Date: Thu, 1 Dec 2011 07:45:37 -0800 (PST)
In-Reply-To: <61d5d201-8635-4ade-b399-30648d3f16ca@x7g2000yqb.googlegroups.com>
References: <61d5d201-8635-4ade-b399-30648d3f16ca@x7g2000yqb.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)
AppleWebKit/534.51.22 (KHTML, like Gecko) Version/5.1.1 Safari/534.51.22,gzip(gfe)
Message-ID: <60c9b758-02ab-4616-ba40-4b6c73fed2ec@l24g2000yqm.googlegroups.com>
Subject: Re: Easy improvement at Save() method
From: Joel <joel...@gmail.com>
To: Php Object Generator <php-object-generator@googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
That's a great suggestion!
Yes, it'd be great if you could contribute more to the project. I put
the source on github recently. Feel free to contribute there.
https://github.com/joelwan/php-object-generator
On Dec 1, 6:04=A0am, Loksly <lok...@gmail.com> wrote:
> Hello everybody,
>
> It's interesting to consider to change the Save() method at template.
> Profiling my projects I've detected that when inserting new objects to
> databases it always makes useless querys like
>
> =A0"select `datatableid` from `datatable` where `datatableid`=3D'' LIMIT
> 1"
>
> although its a fast query is useless and can be prevented with a
> simple code like:
>
> ------------------
> =A0 =A0 =A0 =A0 function Save()
> =A0 =A0 =A0 =A0 {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $connection =3D Database::Connect();
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $rows =3D 0;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ($this->datatableId!=3D''){
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $this->pog_query =3D "sel=
ect `datatableid` from `datatable` where
> `datatableid`=3D'".$this->datatableId."' LIMIT 1";
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 $rows =3D Database::Query=
($this->pog_query, $connection);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }//below is the same code as generated by=
pog.
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ($rows > 0)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 {
> ------------------
>
> Another issue:
>
> Is there anyway I can contribute?
> I've reported a bug:https://bugs.launchpad.net/pog/+bug/811012
> with no reflection at production code.
>
> May I get any kind of access to svn (and commit changes in a beta
> branch or whatever) so I can colaborate in a more effective way?
> I know POG is stable as it is now but I guess new improvements can be
> made.