Exemplo n.º 1
0
 /**
  * Initialize the data with an optional (but recommended family code)
  *
  * @param FamilyInterface $family
  *
  * @throws LogicException
  */
 public function __construct(FamilyInterface $family)
 {
     if (!$family->isInstantiable()) {
         throw new LogicException("Family {$family->getCode()} is not instantiable");
     }
     $this->family = $family;
     $this->createdAt = new DateTime();
     $this->updatedAt = new DateTime();
     $this->values = new ArrayCollection();
     $this->children = new ArrayCollection();
 }