當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::filter方法代碼示例

本文整理匯總了PHP中static::filter方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::filter方法的具體用法?PHP static::filter怎麽用?PHP static::filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::filter方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFilter

 /**
  * getFilter
  *
  * @return  InputFilter
  */
 protected static function getFilter()
 {
     if (!static::$filter) {
         static::$filter = new InputFilter();
     }
     return static::$filter;
 }
開發者ID:rokite,項目名稱:windwalker,代碼行數:12,代碼來源:DefaultFilter.php

示例2: getDashboardBlockTypes

 /**
  * returns an array of Block Types used in the concrete5 Dashboard
  * @return BlockType[]
  */
 public static function getDashboardBlockTypes()
 {
     $btl = new static();
     $btl->filter(false, 'btHandle like \'dashboard_%\'');
     $blockTypes = $btl->get();
     return $blockTypes;
 }
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:11,代碼來源:BlockTypeList.php

示例3: diffByKey

 /**
  * Filter and returns those models that has not been found into another model.
  *
  * @param  PullAutomaticallyGalleries\Support\Collection|PullAutomaticallyGalleries\Database\Eloquent\Collection $items
  * @param  string $key
  * @return PullAutomaticallyGalleries\Database\Eloquent\Collection;
  */
 public function diffByKey($items, $key = 'id')
 {
     $diff = new static($this->items);
     $keyValues = $items->lists($key);
     return $diff->filter(function ($model) use($key, $keyValues) {
         return !in_array($model[$key], $keyValues);
     });
 }
開發者ID:estebanmatias92,項目名稱:pull-automatically-galleries,代碼行數:15,代碼來源:Collection.php

示例4: isValid

 /**
  * Returns true if and only if $value only contains digit characters
  *
  * @param  string $value
  * @return bool
  */
 public function isValid($value)
 {
     if (!is_string($value) && !is_int($value) && !is_float($value)) {
         $this->error(self::INVALID);
         return false;
     }
     $this->setValue((string) $value);
     if ('' === $this->getValue()) {
         $this->error(self::STRING_EMPTY);
         return false;
     }
     if (null === static::$filter) {
         static::$filter = new DigitsFilter();
     }
     if ($this->getValue() !== static::$filter->filter($this->getValue())) {
         $this->error(self::NOT_DIGITS);
         return false;
     }
     return true;
 }
開發者ID:idwsdta,項目名稱:INIT-frame,代碼行數:26,代碼來源:Digits.php

示例5: isValid

 /**
  * Returns true if and only if $value contains only alphabetic characters
  *
  * @param  string $value
  * @return bool
  */
 public function isValid($value)
 {
     if (!is_string($value)) {
         $this->error(self::INVALID);
         return false;
     }
     $this->setValue($value);
     if ('' === $value) {
         $this->error(self::STRING_EMPTY);
         return false;
     }
     if (null === static::$filter) {
         static::$filter = new AlphaFilter();
     }
     //static::$filter->setAllowWhiteSpace($this->allowWhiteSpace);
     static::$filter->setAllowWhiteSpace($this->options['allowWhiteSpace']);
     if ($value !== static::$filter->filter($value)) {
         $this->error(self::NOT_ALPHA);
         return false;
     }
     return true;
 }
開發者ID:eltondias,項目名稱:Relogio,代碼行數:28,代碼來源:Alpha.php

示例6: inline

 /**
  * Static function to execute filter
  * 
  * @param int $value
  * @param array $options
  * @return mixed
  */
 public static function inline($value, $options = array())
 {
     $filter = new static();
     $filter->setOptions($options);
     return $filter->filter($value);
 }
開發者ID:sporkcode,項目名稱:spork,代碼行數:13,代碼來源:AbstractFilter.php

示例7: filtrate

 /**
  * Filters a value.
  *
  * @param mixed $value Input value
  * @return mixed
  */
 public static function filtrate($value)
 {
     $filter = new static();
     return $filter->filter($value);
 }
開發者ID:JerryCR,項目名稱:php-2,代碼行數:11,代碼來源:AbstractFilter.php

示例8: _scan

 /**
  * Scans a given directory for files.
  *
  * @param  string    $path    Path or paths to scan.
  * @param  array     $options Scanning options. Possible values are:
  *                            -`'iterator'`       _integer_     : The iterator mode.
  *                            -`'skipDots'`       _boolean_     : Keeps '.' and '..' if `true`.
  *                            -`'leavesOnly'`     _boolean_     : Keeps only leaves if `true`.
  *                            -`'followSymlinks'` _boolean_     : Follows Symlinks if `true`.
  *                            -`'recursive'`      _boolean_     : Scans recursively if `true`.
  *                            -`'include'`        _string|array_: An array of includes.
  *                            -`'exclude'`        _string|array_: An array of excludes.
  *                            -`'type'`           _string|array_: An array of types.
  * @return array
  */
 protected static function _scan($path, $options, $dirFlags, $iteratorFlags)
 {
     if (!file_exists($path)) {
         throw new Exception("Unexisting path `{$path}`.");
     }
     if (!is_dir($path)) {
         return [$path];
     }
     $worker = new RecursiveDirectoryIterator($path, $dirFlags);
     if ($options['recursive']) {
         $worker = new RecursiveIteratorIterator($worker, $iteratorFlags);
     }
     $filter = new static($worker);
     $filter->filter($options);
     $result = [];
     foreach ($filter as $key => $value) {
         $result[] = $key;
     }
     return $result;
 }
開發者ID:crysalead,項目名稱:kahlan,代碼行數:35,代碼來源:Dir.php

示例9: changes

 /**
  * Pull changes from Active Directory for a given query
  *
  * Use this method to set up a search query and later get all changed objects
  * for that query. This method returns a special {@link Delta} object that preserves
  * your search configuration and you use this object for consequent
  * searches. It also contains your search results. When you run the method for the first time,
  * it behaves as if you performed just an ordinary search, but on consequent searches,
  * it only returns objects that were modified or deleted since you last ran the search query.
  *
  * <br>
  *
  * <p class='alert'>Note that due to the way this feature is implemented it is impossible to
  * search for objects where only specific attributes have been modified - the method returns all objects
  * that were modified in any way since your last execution and it is your task to determine if
  * the changes happened on attributes that you are interested in.</p>
  * <br>
  *
  * This method takes two possible forms of arguments:<br>
  * When you run it for the first time, you pass the search parameters
  * as for any other ldap search query - the search filter, the list of attributes to be
  * returned and a fully configured {@link Link} instance.
  *
  * <br>
  *
  * For all consecutive executions, you only pass the {@link Delta} instance
  * that you got when you ran the method for the first time and, again, a configured {@link Link}
  * instance.
  *
  * <h2>Example:</h2>
  * To watch for changes on all users in your domain:
  * <code>
  * // Establish connection to your directory server
  * $link = new Link( 'example.com' );
  * $link->bind( 'admin@example.com', 'SecretPwd' );
  *
  * // When called for the first time for a particular query, you get
  * // an instance of Delta class - this instance contains the results
  * // of your query as well as all the information/state necessary
  * // to perform subsequent queries to get all changes for that resultset
  * $delta = Task::changes( '(objectcategory=person)', ['mail', 'name', 'memberof'], $link );
  * $result = $delta->result;	// Here's where the actual data is
  * // Do something with result...
  *
  * // Now it's time to store the $delta instance someplace safe so we can get
  * // changes for this query at a later time - you should serialise the instance
  * // and store it somewhere - i.e. in a database or on disk
  * file_put_contents( 'my_query_state.txt', serialize( $delta ) );	// Always serialise!
  *
  * // Many moments pass...
  * // In another script, far, far away...
  *
  * // It's time to see which objects have been modified since our last run
  * // Connect to ldap again
  * $link = new Link( 'example.com' );
  * $link->bind( 'admin@example.com', 'SecretPwd' );
  *
  * // Get the previous query state from the file
  * $delta = unserialize( file_get_contents( 'my_query_state.txt' ) );
  * // And get all the objects that have been changed since we last
  * // run the changes method, but this time we only pass in
  * // the instance of Delta class - it contains all the information
  * // about our previous query so we don't have to configure it again
  * $delta = Task::changes( $delta, $link );
  * $result = $delta->result;	// Changed objects are here again!
  *
  * // Notice that now we have a new instance of the Delta class in the
  * // $class variable - reflecting the fact that we just ran the query again
  *
  * // And so the story continues on and on...
  * </code>
  *
  * <h2>Things you should know</h2>
  * <ul>
  * <li>You must always connect to the same domain controller for a particular query,
  * otherwise you will receive the full resultset on each run</li>
  * <li>To track deleted objects, all returned objects have an <i>isDeleted</i>
  * {@link Attribute} automatically that you can use to check if that object has been deleted</li>
  * <li>You cannot use BaseDN overrides with this feature at this time
  * ( this might be implemented in the future )</li>
  * </ul>
  *
  * @return		Delta		Object containing the state and data of the changes
  *
  * @see			<a href="http://msdn.microsoft.com/en-us/library/ms677627.aspx">MSDN - Polling for changes using usnChanged</a>
  */
 public static function changes()
 {
     $args = func_get_args();
     $link = array_pop($args);
     // Link is always last
     $rootDSE = $link->rootDSE;
     $server = $rootDSE->dnsHostName(0);
     // We will only be able to get a diff when talking to the same server next time
     if ($args[0] instanceof Delta) {
         $last_delta = $args[0];
         $filter = $last_delta->filter;
         $attributes = $last_delta->attributes;
         $boundaryUSN = $last_delta->server == $server ? $last_delta->cookie + 1 : 0;
         // Pull all data if we are dealing with a different server
//.........這裏部分代碼省略.........
開發者ID:alaneor,項目名稱:ad-x,代碼行數:101,代碼來源:Task.php

示例10: __invoke

 /**
  * @param string $uri
  * @param Route  $route
  * @param Router $router
  * @return bool
  */
 public function __invoke($uri, $route, $router)
 {
     static::$instance or static::instance();
     return static::$instance->filter($uri, $route, $router);
 }
開發者ID:phwoolcon,項目名稱:phwoolcon,代碼行數:11,代碼來源:FilterTrait.php

示例11: getFileFilter

 /**
  * getFileFilter
  *
  * @return  FileFilter
  */
 public static function getFileFilter()
 {
     if (!static::$filter) {
         static::$filter = new FileFilter(static::getIgnores());
     }
     return static::$filter;
 }
開發者ID:lyrasoft,項目名稱:lyrasoft.github.io,代碼行數:12,代碼來源:Backup.php

示例12: apply

 /**
  * Provides a static interface for functional use
  *
  * @param string $value
  * 
  * @return string String filtered  
  */
 public static function apply($value)
 {
     $filter = new static();
     return $filter->filter($value);
 }
開發者ID:phpspec,項目名稱:phpspec-zend,代碼行數:12,代碼來源:UCFirst.php

示例13: register

 /**
  * Register a filter method.
  * 
  * @access public
  * @static
  * @param mixed $action
  * @return void
  */
 public static function register($type, $method)
 {
     static::$filter = $method;
     static::$filters[$method] = array('event' => $type, 'action' => $method);
     return static::$instance;
 }
開發者ID:ronan-gloo,項目名稱:FuelPHP-Action-Filter,代碼行數:14,代碼來源:filter.php

示例14: make

 public static function make($html)
 {
     $filter = new static($html);
     return $filter->filter();
 }
開發者ID:SimZal,項目名稱:laracrawl,代碼行數:5,代碼來源:FilterContent.php


注:本文中的static::filter方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。