Пример #1
0
 /**
  * Uzupełnienie województwa o identyfikatory z aplikacyjnych słowników
  *
  * @param array $result
  * @return array
  * @todo refactoring
  */
 private function _amendProvinceDictionary(array $result)
 {
     $data = new Base_Dictionary(Logic_BackendApplication_Chooser::getBackendApplicationId());
     $out = $data->setSource('province', array('ghost = false'), 'entry ASC')->getDictionary()->toArray();
     $mapped = array_map(function ($item) use($out) {
         $item['region_id'] = array_search($item['region'], $out);
         return $item;
     }, $result);
     return $mapped;
 }
Пример #2
0
 protected function province($acl = false, $fieldname = 'province', $label = 'Województwo:', $required = null)
 {
     $dict = new Base_Dictionary(Logic_BackendApplication_Chooser::getBackendApplicationId());
     $method = $acl ? 'addSupervisedElement' : 'addElement';
     $this->{$method}('select', $fieldname, array('required' => is_null($required) ? $this->default_policy : $required, 'label' => $label, 'MultiOptions' => $this->addClearStart($dict->setSource('province', array('ghost = false'), 'entry ASC')->getDictionary())));
     $this->notEmpty($fieldname);
 }