示例#1
0
 /**
  * {@inheritdoc}
  *
  * @return int
  */
 public function extract($model)
 {
     $value = parent::extract($model);
     if ($value === null) {
         return null;
     }
     if (!$value instanceof Carbon) {
         $value = new Carbon($value);
     }
     return $value->getTimestamp();
 }
示例#2
0
文件: Text.php 项目: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['rows' => $this->get('rows', 3)] + parent::toArray();
 }
示例#3
0
 /**
  * @param Entity $entity
  * @param string $id
  * @param string $accessor
  */
 public function __construct(Entity $entity, $id, $accessor = null)
 {
     parent::__construct($entity, $id);
     $this->accessor = $accessor;
 }
示例#4
0
文件: Boolean.php 项目: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function extract($model)
 {
     return (bool) parent::extract($model);
 }
示例#5
0
文件: File.php 项目: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['multiple' => $this->many, 'accepts' => $this->get('accepts', $this->defaultAccepts()), 'unique' => true] + parent::toArray();
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['multiple' => $this->isMultiple(), 'reference' => $this->reference->getId()] + parent::toArray();
 }
示例#7
0
文件: Slug.php 项目: guratr/cruddy
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['chars' => $this->chars, 'field' => $this->field, 'separator' => $this->separator] + parent::toArray();
 }
示例#8
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['append' => Helpers::tryTranslate($this->get('append')), 'prepend' => Helpers::tryTranslate($this->get('prepend'))] + parent::toArray();
 }
示例#9
0
文件: Code.php 项目: cruddy/ace
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     return ['height' => $this->get('height', config('ace.height', 250)), 'theme' => $this->get('theme', config('ace.theme', 'chrome')), 'mode' => $this->get('mode'), 'wordwrap' => $this->get('wordwrap', config('ace.wordwrap', true))] + parent::toArray();
 }