Jarves\Admin\FieldTypes\RelationDefinition::setName PHP Method

setName() public method

public setName ( string $name )
$name string
    public function setName($name)
    {
        $this->name = $name;
    }

Usage Example

Example #1
0
 public function bootRunTime(Object $object, Configs $configs)
 {
     if (!$object->hasRelation($this->getFieldDefinition()->getId())) {
         $relation = new RelationDefinition();
         $relation->setName($this->getFieldDefinition()->getId());
         $relation->setType(AbstractStorage::ONE_TO_MANY);
         $relation->setForeignObjectKey('jarves/content');
         $relation->setRefName($object->getId());
         $object->addRelation($relation);
         $configs->addReboot('Added auto relation because of PageContents type.');
     }
     if (!$object->hasField('layout')) {
         $field = new Field();
         $field->setId('layout');
         $field->setType('text');
         $object->addField($field);
         $configs->addReboot('PageContents needs `layout` field.');
     }
     if (!$object->hasField('theme')) {
         $field = new Field();
         $field->setId('theme');
         $field->setType('text');
         $object->addField($field);
         $configs->addReboot('PageContents needs `theme field.');
     }
 }
All Usage Examples Of Jarves\Admin\FieldTypes\RelationDefinition::setName