/** * {@inheritDoc} */ public function getId() { if ($this->__isInitialized__ === false) { return (int) parent::getId(); } $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array()); return parent::getId(); }
/** * Prepare the category for persist. * * @param \Vlreleases\UserBundle\Entity\Category $category * * @return boolean */ public function register($category) { if (!$category->getId()) { $category->setCreatedDate(new \DateTime()); } $category->setLastModifiedDate(new \DateTime()); $category->setAvailable(1); $category->setCreatedBy($this->getCurrentUser()); $this->save($category); }