Exemple #1
0
 public function __construct(array $config, array $params)
 {
     parent::__construct($config, $params);
     $this->formElement = new \Zend_Form_Element_Select('enseignant_code');
     $dic = $this->getContainer();
     $enseignantAnnee = $dic->get('entitymanager.enseignantannee');
     $this->formElement->setLabel('enseignant');
     $this->formElement->setMultiOptions(array(null => '-- votre choix --') + $enseignantAnnee->getMultiOptions($this->getFiltre($params)));
 }
Exemple #2
0
 /**
  * return where clause
  *
  * @return	bool|array FALSE if no search. Else array with search type and value
  */
 public function getClause()
 {
     if ($this->getValue() != '') {
         if ($this->overrideClause !== false) {
             return parent::getClause();
         } else {
             return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'equals', 'value' => $this->getValue()];
         }
     }
     return false;
 }
Exemple #3
0
 public function __construct(array $config, array $params)
 {
     parent::__construct($config, $params);
     $current = date('Y');
     $multiOptions = array();
     for ($i = $current; $i > 2014; $i--) {
         $multiOptions[$i] = $i;
     }
     $this->formElement = new \Zend_Form_Element_Select('annee');
     $this->formElement->setLabel('année civile');
     $this->formElement->setMultiOptions($multiOptions);
 }
Exemple #4
0
 /**
  * return rendering information
  *
  * @return	array rendering information
  */
 public function getRenderingInformation()
 {
     $data = parent::getRenderingInformation();
     if (isset($this->configuration['min'])) {
         $data['min'] = $this->configuration['min'];
     }
     if (isset($this->configuration['max'])) {
         $data['max'] = $this->configuration['max'];
     }
     if (isset($this->configuration['step'])) {
         $data['step'] = $this->configuration['step'];
     }
     return $data;
 }
Exemple #5
0
 /**
  * return the value
  *
  * @return	string value
  */
 public function getValue()
 {
     $value = parent::getValue();
     if ($value == '') {
         return '';
     }
     $value = date('Y-m-d', $value);
     $date = new \Datetime($value);
     if ($this->configuration['format-output'] == 'timestamp') {
         return $date->getTimestamp();
     }
     return $date->format($this->configuration['format-output']);
 }
Exemple #6
0
 /**
  * set the value
  * 
  * @param	string	$value value
  * @return 	\Ameos\AmeosForm\Elements\ElementAbstract this
  */
 public function setValue($value)
 {
     if (is_array($value)) {
         $this->valueHour = $value['hour'];
         $this->valueMinute = $value['minute'];
         $value = $this->valueMinute . $this->valueHour;
     }
     parent::setValue($value);
     return $this;
 }
Exemple #7
0
 public function setValue($val)
 {
     if (!$val instanceof ObjectModel\ObjectUri) {
         $val = new ObjectModel\ObjectUri($val);
         $val->setClass($this->getCollection()->getClass());
     }
     parent::setValue($val);
 }
Exemple #8
0
 /**
  * return where clause
  *
  * @return	bool|array FALSE if no search. Else array with search type and value
  */
 public function getClause()
 {
     $value = $this->getValue();
     if (!empty($value)) {
         if ($this->overrideClause !== false) {
             return parent::getClause();
         } else {
             if ($this->isMultiple()) {
                 return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'in', 'value' => $value];
             } else {
                 return ['elementname' => $this->getName(), 'elementvalue' => $this->getValue(), 'field' => $this->getSearchField(), 'type' => 'equals', 'value' => $value];
             }
         }
     }
     return false;
 }