コード例 #1
0
ファイル: AlterColumn.php プロジェクト: Textalk/opis-database
 public function defaultValue($value)
 {
     if ($this->get('handleDefault', true)) {
         return parent::defaultValue($value);
     }
     return $this;
 }
コード例 #2
0
ファイル: IP.php プロジェクト: gudwin/extasy
 public function setValue($newValue)
 {
     if ($newValue == '::1') {
         $newValue = '127.0.0.1';
     }
     parent::setValue($newValue);
 }
コード例 #3
0
ファイル: BooleanColumn.php プロジェクト: jarick/bx
 /**
  * Create column
  * @param string $column
  * @param mixed $true
  * @param mixed $false
  * @param boolean $strict
  * @return BooleanColumn
  */
 public static function create($column, $true = 'Y', $false = 'N', $strict = false)
 {
     $return = parent::create($column);
     $return->true = $true;
     $return->false = $false;
     $return->strict = $strict;
     return $return;
 }
コード例 #4
0
ファイル: StrippedColumn.php プロジェクト: Cranky4/npfs
 protected function renderDataCellContent($row, $data)
 {
     ob_start();
     parent::renderDataCellContent($row, $data);
     $str = strip_tags(ob_get_clean());
     if ($this->maxLength !== false) {
         $str = HText::crop($str, $this->maxLength);
     }
     echo nl2br($str);
 }
コード例 #5
0
ファイル: Lists.php プロジェクト: GlobalsDD/admin
 /**
  * @param $instance
  * @param int $totalCount
  * @return string
  */
 public function render($instance, $totalCount)
 {
     $list = $this->valueFromInstance($instance, $this->name);
     $content = [];
     foreach ($list as $item) {
         $content[] = $this->htmlBuilder->tag('li', [], $item);
     }
     $content = $this->htmlBuilder->tag('ul', ['class' => 'list-unstyled'], implode('', $content));
     return parent::render($instance, $totalCount, $content);
 }
コード例 #6
0
 function __construct($name, $text)
 {
     parent::__construct($name);
     $this->text = $text;
 }
コード例 #7
0
 /**
  * @return array
  */
 public function toArray()
 {
     return parent::toArray() + ['editable' => $this->isEditable(), 'editUrl' => $this->getEditUrl(), 'deletable' => $this->isDeletable(), 'deleteUrl' => $this->getDeleteUrl(), 'restorable' => $this->isRestorable(), 'restoreUrl' => $this->getRestoreUrl()];
 }
コード例 #8
0
ファイル: Boolean.php プロジェクト: procoders/admin
 public function valueFromInstance($instance, $name)
 {
     $value = parent::valueFromInstance($instance, $name);
     return (string) view('admin::_partials/columns/boolean')->with('value', $value == 1 ? true : false);
 }
コード例 #9
0
 function __construct($name, $callable)
 {
     parent::__construct($name);
     $this->callable = $callable;
 }
コード例 #10
0
ファイル: NumberColumn.php プロジェクト: jarick/bx
 /**
  * Create column
  * @param string $column
  * @param bollean $integer
  * @return self
  */
 public static function create($column, $integer = true)
 {
     $return = parent::create($column);
     $return->integer = $integer;
     return $return;
 }
コード例 #11
0
ファイル: HasOne.php プロジェクト: gudwin/extasy
 public function onUpdate(\Extasy\ORM\QueryBuilder $queryBuilder)
 {
     parent::onUpdate($queryBuilder);
     $this->autoCreate();
 }
コード例 #12
0
ファイル: DateColumn.php プロジェクト: summer11123/Datatable
 function __construct($name, $format = 2, $custom = "")
 {
     parent::__construct($name);
     $this->format = $format;
     $this->custom = $custom;
 }
コード例 #13
0
ファイル: TimestampColumn.php プロジェクト: jarick/bx
 /**
  * Create column
  * @param string $column
  * @param string $format
  * @return self
  */
 public static function create($column, $format = 'full')
 {
     $return = parent::create($column);
     $return->setFormat($format);
     return $return;
 }
コード例 #14
0
ファイル: Count.php プロジェクト: greysama/admin
 public function render($instance, $totalCount)
 {
     $content = count($this->valueFromInstance($instance, $this->name));
     return parent::render($instance, $totalCount, $content);
 }
コード例 #15
0
ファイル: CreateColumn.php プロジェクト: opis/database
 /**
  * Constructor
  * 
  * @param   CreateTable $table
  * @param   string      $name
  * @param   string      $type
  */
 public function __construct(CreateTable $table, $name, $type)
 {
     $this->table = $table;
     parent::__construct($name, $type);
 }
コード例 #16
0
ファイル: Control.php プロジェクト: argentum88/phad
 /**
  * Initialize column
  */
 public function initialize()
 {
     parent::initialize();
     //AssetManager::addScript('admin::default/js/bootbox.js');
     //AssetManager::addScript('admin::default/js/columns/control.js');
 }
コード例 #17
0
ファイル: Boolean.php プロジェクト: gudwin/extasy
 public function setValue($newValue)
 {
     parent::setValue(boolval($newValue));
 }