protected function addObject(TBase $object) { $obj = Object\Base::create($object, $this->localCache); $this->objs[] = $obj; $this->objAnnotation[] = $object; $this->annotations->merge($obj->getAnnotations()); }
protected function addObject(TBase $object) { $cache = strtolower(get_class($object) . '::' . $object->getName()); if (!empty($object->class)) { $cache .= '::' . strtolower($object->class->getName()); } if (empty($this->objs[$cache])) { $obj = Object\Base::create($object); $this->objs[$cache] = $obj; $this->objAnnotation[$cache] = $object; $this->annotations->merge($obj->getAnnotations()); } }
public function getDiscriminator($obj = false) { $prop = '__type'; if ($single = $this->annotation->getOne('SingleCollection')) { $args = $single->getArgs(); if (!empty($args)) { $prop = current($args); } } if ($obj) { $property = new \crodas\ClassInfo\Definition\TProperty('$' . $prop); $prop = new Property($this, \Notoj\Object\Base::create($property, NULL)); } return $prop; }