示例#1
0
 /**
  * Find a field by it's id and scope (page or global)
  *
  * @param  integer $fieldId
  * @param  string  $fieldScope
  * @return DvsField || DvsGlobalField
  */
 public function findFieldByIdAndScope($fieldId, $fieldScope)
 {
     return $fieldScope == 'global' ? $this->GlobalField->find($fieldId) : $this->Field->find($fieldId);
 }
示例#2
0
 public function test_it_finds_trashed_global_fields_by_key_and_language()
 {
     \DvsGlobalField::find(1)->delete();
     $output = $this->FieldsRepository->findTrashedGlobalFieldByKeyAndLanguage('key1', 45);
     assertEquals(1, $output->id);
 }