コード例 #1
0
ファイル: DateSelect.php プロジェクト: coolms/common
 /**
  * {@inheritDoc}
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if ($options instanceof Traversable) {
         $options = ArrayUtils::iteratorToArray($options);
     }
     if (isset($options['max_date'])) {
         $this->setMaxDate($options['max_date']);
     }
     if (isset($options['min_date'])) {
         $this->setMinDate($options['min_date']);
     }
     return $this;
 }
コード例 #2
0
ファイル: DateTimeSelect.php プロジェクト: JeoffScott/dyplom
 /**
  * Accepted options for DateTimeSelect (plus the ones from DateSelect) :
  * - hour_attributes: HTML attributes to be rendered with the hour element
  * - minute_attributes: HTML attributes to be rendered with the minute element
  * - second_attributes: HTML attributes to be rendered with the second element
  * - should_show_seconds: if set to true, the seconds select is shown
  *
  * @param array|\Traversable $options
  * @return DateSelect
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if (isset($options['hour_attributes'])) {
         $this->setHourAttributes($options['hour_attributes']);
     }
     if (isset($options['minute_attributes'])) {
         $this->setMinuteAttributes($options['minute_attributes']);
     }
     if (isset($options['second_attributes'])) {
         $this->setSecondAttributes($options['second_attributes']);
     }
     if (isset($options['should_show_seconds'])) {
         $this->setShouldShowSeconds($options['should_show_seconds']);
     }
     return $this;
 }
コード例 #3
0
ファイル: DateTimeSelect.php プロジェクト: Flesh192/magento
 /**
  * Set options for DateTimeSelect element.
  *
  * Accepted options for DateTimeSelect (plus the ones from DateSelect):
  *
  * - hour_attributes: HTML attributes to be rendered with the hour element
  * - minute_attributes: HTML attributes to be rendered with the minute element
  * - second_attributes: HTML attributes to be rendered with the second element
  * - should_show_seconds: if set to true, the seconds select is shown
  *
  * @param array|Traversable $options
  * @return self
  */
 public function setOptions($options)
 {
     parent::setOptions($options);
     if ($options instanceof Traversable) {
         $options = ArrayUtils::iteratorToArray($options);
     }
     if (isset($options['hour_attributes'])) {
         $this->setHourAttributes($options['hour_attributes']);
     }
     if (isset($options['minute_attributes'])) {
         $this->setMinuteAttributes($options['minute_attributes']);
     }
     if (isset($options['second_attributes'])) {
         $this->setSecondAttributes($options['second_attributes']);
     }
     if (isset($options['should_show_seconds'])) {
         $this->setShouldShowSeconds($options['should_show_seconds']);
     }
     return $this;
 }