/** * @return ClassBuilderProperty */ public function createPropertyIfNotExists($propertyName, Type $type = NULL) { if ($this->classBuilder->hasProperty($propertyName)) { return $this->classBuilder->getProperty($propertyName); } else { return $this->classBuilder->addProperty($propertyName, $type); } }
/** * * Hilfsfunktion zum ermöglichen von geilen chainables: * * $cb = new ClassBuilder(); * $cb->addProperty('eins')->setType('MyType1')->addProperty('zwei'->setType('MyType2') * * usw */ public function addProperty($name) { return $this->builder->addProperty($name); }