adding ezAuthor to content object

adding ezAuthor to content object

Wednesday 02 May 2007 7:36:45 am - 2 replies

Author Message

Atle Pedersen

Friday 04 May 2007 1:35:29 am

What you do is supposed to work:

        $object->setAttribute( 'owner_id', $ownerID );
        $object->store();

Lazaro Ferreira

Monday 07 May 2007 4:30:13 am

Hi Arnaud,

The ezauthor datatype is a composite datatype (its content is actually an object of class eZAuthor

I think you need to create a new eZAuthor object and then set the contentobjectattribute content, before trying to store the attribute

    $author = new eZAuthor( );
    $i = 0;
    foreach ( $authorIDArray as $id )
     {
        $author->addAuthor( $authorIDArray[$i], $authorNameArray[$i], $authorEmailArray[$i] );
        $i++;
     }
     $contentObjectAttribute->setContent( $author );

Lazaro
http://www.mzbusiness.com

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.