getInstanceForTag() public method

Find this tag in the database
public getInstanceForTag ( array $tag ) : DvsField | DvsCollection | DvsModelField | DvsGlobalField
$tag array
return DvsField | DvsCollection | DvsModelField | DvsGlobalField | DvsCollection | DvsModelField | DvsGlobalField
Beispiel #1
0
 /**
  * Resolve the variable tag
  * @param  string $id
  * @param  string $bindingType
  * @param  string $collection
  * @param  string $key
  * @param  string $type
  * @param  string $humanName
  * @param  string $group
  * @param  string $category
  * @param  string $alternateTarget
  * @param  mixed $defaults
  * @return string
  */
 protected function resolveVariableTag($id, $bindingType, $collection, $key, $type, $humanName, $collectionName, $group, $category, $alternateTarget, $defaults)
 {
     list($model, $attribute) = $this->extractModelFromKey($key);
     $tag = $this->tags[$id];
     $tag['id'] = $id;
     $tag['bindingType'] = $attribute ? 'attribute' : 'model';
     $tag['collection'] = $collection;
     $tag['key'] = $model->getKey();
     $tag['type'] = get_class($model);
     $tag['humanName'] = $humanName;
     $tag['collectionName'] = $collectionName;
     $tag['group'] = $group;
     $tag['category'] = $category;
     $tag['alternateTarget'] = $alternateTarget;
     $tag['defaults'] = $defaults;
     $tag['model'] = $model;
     if ($attribute) {
         $tag['attribute'] = $attribute;
     }
     $tag['data'] = $this->TagManager->getInstanceForTag($tag);
     if ($attribute) {
         $tag['cid'] = $tag['bindingType'] . $tag['data']->id;
     } else {
         $tag['cid'] = $tag['bindingType'] . $this->cids[$tag['bindingType']]++;
     }
     $this->tags[] = $tag;
     return $tag;
 }