findFieldByKeyAndPageVersion() public méthode

Find existing page field given key and pageId
public findFieldByKeyAndPageVersion ( string $key, $pageVersionId, $collectionInstanceId ) : Field
$key string
Résultat Field
Exemple #1
0
 /**
  * Changes this global field to a page field
  *
  * @param  array           $fieldInput
  * @param  array           $pageInput
  * @return DvsField
  */
 protected function changeToPageField($fieldInput, $pageInput)
 {
     $field = $this->FieldsRepository->findTrashedFieldByKeyAndPageVersion($fieldInput['key'], $pageInput['page_version_id']);
     if ($field) {
         $field->restore();
         return $field;
     }
     $field = $this->FieldsRepository->findFieldByKeyAndPageVersion($fieldInput['key'], $pageInput['page_version_id'], null);
     return $field ?: $this->newPageField($pageInput['page_version_id'], $fieldInput['key'], $fieldInput['type'], $fieldInput['human_name']);
 }