Forums / General / Bad obj name when directly echo name after import

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Bad obj name when directly echo name after import

Author Message

Bin LIU

Tuesday 07 April 2009 2:28:23 am

Hi,
I do a ez import script.

function createObj(xxx)
{
    ......
    $object->store();
    $operationResult = eZOperationHandler :: execute('content', 'publish', array ('object_id' =>     $object->attribute('id'), 'version' => 1 ) );
    eZContentObject::clearCache();
    return $object;
}

And when I insert a new object class name TEST

$o = createObj(xxx);
echo $o->attribute('name'); 
echo $o->name();

it output "New TEST"

But if I do

$o = createObj(xxx);
$o1 = eZContentObject::fetch($o->attribute("id"));
echo $o1->attribute('name'); 
echo $o1->name();

It output the good name

Why ??
tks

 

=== Lagardère Active ===

Fetch random
http://projects.ez.no/la_fetch_random
LA Static Cache
http://projects.ez.no/lastaticcache
LA Bookmarks (jquery)
http://projects.ez.no/labookmark
LA Calendar (jquery)
http://projects.ez.no/lacalendar

My site ez
http://lingping.info