コード例 #1
0
ファイル: DateColumn.php プロジェクト: cocur/arff
 /**
  * @return string
  */
 public function render()
 {
     $dateFormat = $this->getDateFormat();
     if ($dateFormat !== null) {
         $dateFormat = sprintf(' "%s"', $dateFormat);
     }
     return parent::render() . $dateFormat;
 }
コード例 #2
0
ファイル: Boolean.php プロジェクト: phabi1/pistache-datagrid
 public function setOptions(array $options = array())
 {
     if (isset($options['yes_label'])) {
         $this->setYesLabel($options['yes_label']);
         unset($options['yes_label']);
     }
     if (isset($options['no_label'])) {
         $this->setNoLabel($options['no_label']);
         unset($options['no_label']);
     }
     return parent::setOptions($options);
 }
コード例 #3
0
 /**
  * @return string
  */
 public function getValidationRule()
 {
     $rule = parent::getValidationRule();
     return $rule . '|regex:/\\A[0-9]+\\z/';
 }
コード例 #4
0
 /**
  * @return string
  */
 public function getValidationRule()
 {
     $rule = parent::getValidationRule();
     return $rule . '|regex:/\\A[0-9]+\\z/|exists:' . $this->getForeignTable() . ',id';
 }
コード例 #5
0
 public function __construct($header, $propertyName)
 {
     parent::__construct($header);
     $this->propertyName = $propertyName;
 }
コード例 #6
0
 /**
  * @param array $data
  * @return ColumnDt
  */
 public function hydrate(array $data)
 {
     parent::hydrate($data);
     return $this->setServer((new ServerDt())->hydrate($data['server']));
 }
コード例 #7
0
 /**
  * @param array $data
  * @return ColumnParams
  */
 public function hydrate(array $data)
 {
     parent::hydrate($data);
     return $this->setSearch((new SearchParams())->hydrate($data['search']));
 }
コード例 #8
0
ファイル: Pgsql.php プロジェクト: hschletz/nada
 /** {@inheritdoc} */
 protected function _parseDefault($data)
 {
     // Do not use the default from autoincrement columns.
     // See _isAutoIncrement() for an explanation.
     if (!$this->_isAutoIncrement($data)) {
         parent::_parseDefault($data);
         // Extract value from typed defaults
         if (preg_match("/^('(.*)'|NULL)::{$data['data_type']}\$/", $this->_default, $matches)) {
             if ($matches[1] == 'NULL') {
                 $this->_default = null;
             } else {
                 // String without surrounding quotes. Quote characters
                 // within the string must be unescaped first.
                 $this->_default = str_replace("''", "'", $matches[2]);
             }
         }
     }
 }