Пример #1
0
 protected function addObject(TBase $object)
 {
     $obj = Object\Base::create($object, $this->localCache);
     $this->objs[] = $obj;
     $this->objAnnotation[] = $object;
     $this->annotations->merge($obj->getAnnotations());
 }
Пример #2
0
 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());
     }
 }
Пример #3
0
 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;
 }