getProperties() public method

public getProperties ( ) : PropertyMetadata[]
return PropertyMetadata[]
Exemplo n.º 1
0
 protected function loadGettersSetters()
 {
     $methods = [];
     foreach ($this->reflection->getMethods() as $method) {
         $methods[strtolower($method->name)] = $method;
     }
     foreach ($this->metadata->getProperties() as $name => $property) {
         $getter = 'getter' . strtolower($name);
         if (isset($methods[$getter])) {
             $property->hasGetter = TRUE;
         }
         $setter = 'setter' . strtolower($name);
         if (isset($methods[$setter])) {
             $property->hasSetter = TRUE;
         }
     }
 }
Exemplo n.º 2
0
 protected function onRefresh(array $data)
 {
     foreach ($this->metadata->getProperties() as $name => $metadataProperty) {
         if (!$metadataProperty->isVirtual && isset($data[$name])) {
             $this->internalSetValue($metadataProperty, $name, $data[$name]);
         }
     }
 }
 protected function onLoad(array $data)
 {
     foreach ($this->metadata->getProperties() as $name => $metadataProperty) {
         if (!$metadataProperty->isVirtual && isset($data[$name])) {
             $this->data[$name] = $data[$name];
         }
     }
     $this->persistedId = $this->getterId();
 }
Exemplo n.º 4
0
 protected function initPrimaryKey()
 {
     $primaryKey = array_values(array_filter(array_map(function (PropertyMetadata $metadata) {
         return $metadata->isPrimary && !$metadata->isVirtual ? $metadata->name : null;
     }, $this->metadata->getProperties())));
     if (empty($primaryKey)) {
         throw new InvalidStateException("Entity {$this->reflection->name} does not have defined any primary key.");
     } elseif (!$this->metadata->hasProperty('id') || !$this->metadata->getProperty('id')->isPrimary) {
         throw new InvalidStateException("Entity {$this->reflection->name} has to have defined \$id property as {primary} or {primary-proxy}.");
     }
     $this->metadata->setPrimaryKey($primaryKey);
 }
Exemplo n.º 5
0
 protected function attached($form)
 {
     parent::attached($form);
     $this->setCurrentGroup($this->getForm()->addGroup($this->prefixContainer('group')));
     $this->addProperties($this->metadata->getProperties());
 }