Ejemplo n.º 1
0
 /**
  * Return datasource filters
  *
  * @param \Engine\Crud\Container\AbstractContainer $container
  * @return \Engine\Filter\SearchFilterInterface
  */
 public function getFilter(Container $container)
 {
     $values = $this->getValue();
     if ($values) {
         return parent::getFilter($container);
     }
     return false;
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @param string $label
  * @param string $name
  * @param string $criteria
  * @param string $delimiter
  */
 public function __construct($label = null, $name = null, $criteria = Criteria::CRITERIA_IN, $delimiter = ",")
 {
     $this->_delimiter = $delimiter;
     parent::__construct($name, $label, $criteria);
 }
Ejemplo n.º 3
0
 /**
  * Initialize field (used by extending classes)
  *
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     $this->_validators[] = ['Numericality'];
 }
Ejemplo n.º 4
0
 /**
  * Constructor
  *
  * @param string $label
  * @param string $name
  * @param array $options
  * @param string $desc
  * @param string $criteria
  * @param int $width
  * @param int $default
  */
 public function __construct($label = null, $name = null, array $options = [], $desc = null, $criteria = Criteria::CRITERIA_EQ, $width = 280, $default = null)
 {
     parent::__construct($label, $name, $desc, $criteria, $width, $default);
     $this->_options = $options;
 }
Ejemplo n.º 5
0
 /**
  * Constuctor
  *
  * @param string $label
  * @param string $name
  * @param array $fields
  * @param string $desc
  * @param int $width
  * @param string $default
  * @param int $length
  */
 public function __construct($label = null, $name = null, array $fields, $desc = null, $width = 280, $default = null, $length = 255)
 {
     parent::__construct($label, $name, $desc, Criteria::CRITERIA_EQ, $width, $default, $length);
     $this->_fields = $fields;
 }
Ejemplo n.º 6
0
 /**
  * Apply field filter value to dataSource
  *
  * @param mixed $dataSource
  * @param \Engine\Crud\Container\AbstractContainer $container
  * @return \Engine\Crud\Grid\Filter\Field
  */
 public function applyFilter($dataSource, Container $container)
 {
     $model = $dataSource->getModel();
     $this->_name = $model->getNameExpr();
     return parent::applyFilter($dataSource, $container);
 }
Ejemplo n.º 7
0
 /**
  * @param string $name
  * @param string $label
  * @param string|array $fields
  */
 public function __construct($label = null, $name = false, $fields)
 {
     parent::__construct($label, $name);
     $this->_fields = is_array($fields) ? $fields : [$fields];
 }
Ejemplo n.º 8
0
 /**
  * Constructor
  *
  * @param string $label
  * @param string $name
  * @param array $fields
  */
 public function __construct($label = null, $name = null, array $fields)
 {
     parent::__construct($label, $name);
     $this->_fields = $fields;
 }
Ejemplo n.º 9
0
 /**
  * Initialize field (used by extending classes)
  *
  * @return void
  */
 protected function _init()
 {
     parent::_init();
     $this->_filters[] = ['filter' => 'trim', 'options' => []];
     $this->_validators[] = ['validator' => 'StringLength', 'options' => ['max' => $this->_length]];
 }