Thanks Marco, now I understand namespaces a little bit more and my
"toDojoArray" method works now.
Since the getInsertDatetime returns a Doctrine DateTime object I had to
format it. The \Zend_Date works fine now too.


    public function toDojoArray()
    {
        $creationDate  = (!null == $this->getInsertDatetime()) ? new
\Zend_Date($this->getInsertDatetime()->format('Y-m-d H:i:s') : new
\Zend_Date();

        $data = array(
            'id'             => $this->getId(),
            'name'           => $this->getHistoryName(),
            'creationDate'  => array(
                "_type"  => "Date",
                "_value" => $creationDate->get(Zend_Date::ISO_8601)
            ),
            'creationDate'   => $this->getCreationDate()
        );

        return $data;
    }


I added the My_ (/library/My/) namespace to the Doctrine autoloader in my
Bootstrap.php


public function _initDoctrine() {
        $classLoader = new \Doctrine\Common\ClassLoader('MY',
APPLICATION_PATH . '/../library');
        $classLoader->register();
}


and tried to extend the entity by using

class History extends My_Entity_Base.

Is this the right way?

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Extending-Doctrine-entities-using-Zend-an-My-library-tp3456839p3456947.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to