This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
class Person { | |
/** | |
* @ORM\Column(type="string") | |
* @Assert\NotBlank(message = "person_firstname_error") | |
*/ | |
protected $firstname = ''; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* File - Family.php */ | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Family relationship | |
* | |
* @ORM\Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
/** | |
* Family relationship | |
* | |
* @ORM\Entity | |
* @ORM\Table(name="family") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Mapping as ORM; | |
use Symfony\Component\Validator\Constraints as Assert; | |
/** | |
* Profile for a person who will be included within a family tree | |
* | |
* @ORM\Entity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$family = loadEntity('Family', 1); // wrapper for entity manager | |
// verify that there are more than one child | |
echo "There are ".count($family->getChildren())." children"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\Common\ClassLoader; | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
public function _initDoctrine() { | |
$options = $this->getPluginResource('doctrine')->getOptions(); | |
$container = new \Bisna\Doctrine\Container($options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Form for adding a signing up a user | |
* | |
*/ | |
class SignUpForm extends Zend_Form | |
{ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Execute getters and setters on the instance if they do not exist | |
* | |
* @param String $method The method to execute | |
* @param Array $args The method arguments | |
* | |
* @throws Exception if the property does not exist | |
*/ | |
function __call($method, $args){ | |
$attribute = strtolower(substr($method, 3, 1).substr($method, 4)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function testTheTreeWithCascadesForRootandOneChild() { | |
$meta = $this->em->getClassMetadata(self::CATEGORY); | |
$root = new Category(); | |
$root->setTitle("Root"); | |
$this->assertTrue($root instanceof Node); | |
$child = new Category(); | |
$child->setTitle("child"); | |
$child->setParent($root); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`gandaancestry`.`category`, CONSTRAINT `fk_category_root` FOREIGN KEY (`root`) REFERENCES `category` (`id`) ON DELETE SET NULL ON UPDATE SET NULL)' in D:\Program Files\Apache Group\Apache\htdocs\gandaancestry\library\Doctrine\DBAL\Statement.php:131 Stack trace: #0 D:\Program Files\Apache Group\Apache\htdocs\gandaancestry\library\Doctrine\DBAL\Statement.php(131): PDOStatement->execute(NULL) #1 D:\Program Files\Apache Group\Apache\htdocs\gandaancestry\library\Doctrine\ORM\Persisters\BasicEntityPersister.php(239): Doctrine\DBAL\Statement->execute() #2 D:\Program Files\Apache Group\Apache\htdocs\gandaancestry\library\Doctrine\ORM\UnitOfWork.php(896): Doctrine\ORM\Persisters\BasicEntityPersister->executeInserts() #3 D:\Program Files\Apache Group\Apache\htdocs\gandaancestry\library\Doctrine\ORM\UnitOfWork.php(304): Doctrine\ORM\UnitOfWork->executeInserts(Object(Doctrin |
OlderNewer