Esempio n. 1
0
 /**
  * Check to be sure we have the HTML purifier library
  * @param \Foundation\Form\Element $e
  * @param mixed $ruleSet 
  */
 public function __construct(\Foundation\Form\Element $e, $ruleSet = null)
 {
     parent::__construct($e, $ruleSet);
     if (!class_exists('HTMLPurifier')) {
         throw new \Foundation\Exception('HTML Purifier is required for the SafeHTML filter and it is not included');
     }
 }
Esempio n. 2
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     parent::prepare();
     $this->applyFilter();
     $jsConfig = $this->getConfiguration($this);
     $this->getContext()->addComponentDefinition($this->getComponentName(), $jsConfig);
 }
 /**
  * {@inheritDoc}
  */
 protected function combine($previous, $current, $separator)
 {
     if (is_array($current)) {
         $current = implode($separator, array_filter($current));
     }
     return parent::combine($previous, $current, $separator);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function getOutputResponse($output)
 {
     if (null !== $this->outputCallback) {
         return call_user_func($this->outputCallback, $output, $this);
     }
     return parent::getOutputResponse($output);
 }
Esempio n. 5
0
 /**
  * Constructor
  * Ensure a valid PKI object is passed
  * @param \Foundation\Form\Element $e
  * @param \Foundation\PKI $pki
  */
 public function __construct(\Foundation\Form\Element $e, $pki)
 {
     if (!$pki instanceof \Foundation\PKI) {
         throw new \Foundation\Exception('Invalid PKI class passed to Encrypt filter');
     }
     parent::__construct($e, $pki);
 }
Esempio n. 6
0
 function setOption($name, $value)
 {
     parent::setOption($name, $value);
     // reset the obfuscator in case the options are changed during the usage
     $this->obfuscator = null;
     return $this;
 }
Esempio n. 7
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $array = parent::toArray();
     $baseName = $this->_getBaseName();
     if (isset($array[$baseName]['query'])) {
         $array[$baseName]['query'] = $array[$baseName]['query']['query'];
     }
     return $array;
 }
Esempio n. 8
0
 /**
  * @see \Elastica\Param::toArray()
  *
  * @return array
  */
 public function toArray()
 {
     $data = parent::toArray();
     $name = $this->_getBaseName();
     $filterData = $data[$name];
     if (empty($filterData)) {
         $filterData = $this->_filters;
     } else {
         $filterData['filters'] = $this->_filters;
     }
     $data[$name] = $filterData;
     return $this->_convertArrayable($data);
 }
Esempio n. 9
0
 /**
  * Converts object to an array.
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  *
  * @return array data array
  */
 public function toArray()
 {
     $this->setParam($this->_field, $this->_prefix);
     return parent::toArray();
 }
Esempio n. 10
0
 /**
  * @param string $platform
  * @param bool   $negateFilter
  */
 public function __construct($platform, $negateFilter = false)
 {
     parent::__construct('Plattform');
     $this->filterValues['FilterValue'] = $negateFilter ? 'not_' . $platform : $platform;
 }
Esempio n. 11
0
 public function __construct()
 {
     parent::__construct('RangeID');
 }
Esempio n. 12
0
 /**
  * Overrides the parent to handle floats in locales where the decimal separator is a comma instead of a dot
  *
  * @param   mixed   $value
  * @param   string  $operator
  *
  * @return  string
  */
 public function search($value, $operator = '=')
 {
     $value = $this->sanitiseValue($value);
     return parent::search($value, $operator);
 }
Esempio n. 13
0
 /**
  * Returns a string representation of the filter.
  *
  * @return string
  */
 public function toString()
 {
     return '(!' . $this->filter->toString() . ')';
 }
 /**
  * @param string $flagId
  */
 public function __construct($flagId)
 {
     parent::__construct('UserDefinedFlag');
     $this->filterValues['FilterValue'] = $flagId;
 }
Esempio n. 15
0
 /**
  * @param int $orderId
  */
 public function __construct($orderId)
 {
     parent::__construct('OrderID');
     $this->filterValues['FilterValue'] = strval($orderId);
 }
Esempio n. 16
0
 /**
  * Converts object to array
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  * @return array Filter array
  */
 public function toArray()
 {
     $this->setParams(array_merge($this->getParams(), $this->_fields));
     return parent::toArray();
 }
 /**
  * Register the filter function with the dump manager
  * @param BackupDumper $dumper
  * @static
  */
 function register(&$dumper)
 {
     $dumper->registerFilter('googlecoop', 'GoogleCoopFilter');
     parent::register($dumper);
 }
Esempio n. 18
0
 /**
  * @inheritdoc
  */
 protected function getMappingValidate() : array
 {
     return array_merge(parent::getMappingValidate(), [self::UPDATED_BEFORE => [$this, 'validateTimestamp'], self::UPDATED_AFTER => [$this, 'validateTimestamp']]);
 }
 function __construct($param)
 {
     parent::__construct($param);
     $this->_operator = $this->parseOperatorFromParam($this->_param);
     $this->_value = $this->parseValueFromParam($this->_param);
 }
Esempio n. 20
0
 /**
  * @param string $email
  */
 public function __construct($email)
 {
     parent::__construct('AfterbuyUserEmail');
     $this->filterValues['FilterValue'] = $email;
 }
Esempio n. 21
0
 /**
  * Converts object to array
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  * @return array Filter array
  */
 public function toArray()
 {
     $this->setParams($this->_fields);
     return parent::toArray();
 }
Esempio n. 22
0
 /**
  * @param string $filterValue
  */
 public function __construct($filterValue)
 {
     parent::__construct('DefaultFilter');
     $this->filterValues['FilterValue'] = $filterValue;
 }
Esempio n. 23
0
 /**
  * @param int $userId
  */
 public function __construct($userId)
 {
     parent::__construct('AfterbuyUserID');
     $this->filterValues['FilterValue'] = strval($userId);
 }
Esempio n. 24
0
 /**
  * @param int $shopId
  */
 public function __construct($shopId)
 {
     parent::__construct('ShopId');
     $this->filterValues['FilterValue'] = strval($shopId);
 }
Esempio n. 25
0
 /**
  * Prepare component configuration
  *
  * @return void
  */
 public function prepare()
 {
     $this->applyFilter();
     parent::prepare();
 }
Esempio n. 26
0
File: Text.php Progetto: Joal01/fof
 /**
  * Constructor
  *
  * @param   \JDatabaseDriver  $db     The database object
  * @param   object  $field  The field informations as taken from the db
  */
 public function __construct($db, $field)
 {
     parent::__construct($db, $field);
     $this->null_value = '';
 }
Esempio n. 27
0
 /**
  * Set filter
  *
  * @param  \Elastica\Filter\AbstractFilter $filter
  * @return \Elastica\Filter\BoolNot
  */
 public function setFilter(AbstractFilter $filter)
 {
     return $this->setParam('filter', $filter->toArray());
 }
 /**
  * Converts object to an array.
  *
  * @see \Elastica\Filter\AbstractFilter::toArray()
  *
  * @return array data array
  */
 public function toArray()
 {
     if (count($this->_options) > 0) {
         $options = array('value' => $this->_regexp);
         $options = array_merge($options, $this->_options);
         $this->setParam($this->_field, $options);
     } else {
         $this->setParam($this->_field, $this->_regexp);
     }
     return parent::toArray();
 }
Esempio n. 29
0
 /**
  * AbstractFilter constructor.
  *
  * @param bool $break If true break after the filter if value is unique.
  * @param int  $start Start value.
  */
 public function __construct($break = true, $start = 2)
 {
     parent::__construct($break, static::COMBINE_APPEND);
     $this->start = (int) $start;
 }
 /**
  * Set the filter to be applied to docs in indices which do not match those specified in the "indices" parameter
  * @param AbstractFilter $filter
  * @return Indices
  */
 public function setNoMatchFilter(AbstractFilter $filter)
 {
     return $this->setParam('no_match_filter', $filter->toArray());
 }