Automate record creation in temp tables

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Feb 11, 2010, 10:20:52 AM2/11/10
to In-Portal Development
I propose we move code

if ($object->IsTempTable()) {
    $object->setTempID();
}

into kDBItem::Create method, so when sub-item is being create in temp table, then it's ID is automatically assigned.

--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Alexander Obuhovich

unread,
Feb 11, 2010, 10:52:08 AM2/11/10
to In-Portal Development
Also, when using temp tables and you are in OnAfterItemCreate method, then $object->GetID() will return 0 instead of -1/-2/etc., because setTempID() is called after kDBItem::Create() method is executed completely.

Dmitry A.

unread,
Feb 11, 2010, 10:59:01 AM2/11/10
to In-Portal Development Team
Any possible implications if we removed that?

if ($object->IsTempTable()) {
$object->setTempID();
}

DA.

On Feb 11, 9:52 am, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> Also, when using temp tables and you are in OnAfterItemCreate method, then
> $object->GetID() will return 0 instead of -1/-2/etc., because setTempID() is
> called after kDBItem::Create() method is executed completely.
>

> On Thu, Feb 11, 2010 at 5:20 PM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
> > I propose we move code
>

> > *if ($object->IsTempTable()) {
> >     $object->setTempID();
> > }
> > *

Alexander Obuhovich

unread,
Feb 11, 2010, 11:14:01 AM2/11/10
to in-por...@googlegroups.com
We don't remove, we move it up into deeper code, what calls OnAfterItemCreate. Implications would be if you miss to add it in your own code.

Dmitry A.

unread,
Feb 11, 2010, 11:33:03 AM2/11/10
to In-Portal Development Team
Great - would you please upload the patch so we can review and test
it as a bug then.

DA.

Alexander Obuhovich

unread,
Mar 14, 2010, 4:57:58 PM3/14/10
to in-por...@googlegroups.com

Alexander Obuhovich

unread,
Mar 14, 2010, 4:59:32 PM3/14/10
to in-por...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages