Exemplo n.º 1
0
 /**
  * @param string $name
  * @param mixed $value
  * @param string $type
  * @param bool $_get
  * @param string $visibility
  * @param bool $_lazy
  * @return \Symforce\AdminBundle\Compiler\Generator\PhpProperty
  */
 public function addProperty($name, $value, $type = null, $_get = false, $visibility = 'protected', $_lazy = false)
 {
     $property = new PhpProperty($name);
     if (null === $type) {
         $type = is_object($value) ? get_class($value) : gettype($value);
     }
     $property->setClass($this)->setDocblock('/** @var ' . $type . ' */')->setVisibility($visibility)->setDefaultValue($value)->useGetter($_get)->setLazy($_lazy);
     return $this;
 }