getOptions() public method

public getOptions ( array $fields = [], boolean $withUnderscore = false ) : array
$fields array if empty array all options will be returned, field names can be either with underscored either without, i.e. _percolate, routing
$withUnderscore boolean should option keys contain underscore prefix
return array
Example #1
0
    /**
     * @param  \Elastica\AbstractUpdateAction $source
     * @return array
     */
    protected function _getMetadata(AbstractUpdateAction $action)
    {
        $params = array(
            'index',
            'type',
            'id',
            'version',
            'version_type',
            'routing',
            'percolate',
            'parent',
            'ttl',
            'timestamp',
            'retry_on_conflict',
        );
        $metadata = $action->getOptions($params, true);

        return $metadata;
    }
Example #2
0
 /**
  * @param  \Elastica\AbstractUpdateAction $action
  * @return array
  */
 protected function _getMetadata(AbstractUpdateAction $action)
 {
     $params = array('index', 'type', 'id', 'version', 'version_type', 'routing', 'parent');
     $metadata = $action->getOptions($params, true);
     return $metadata;
 }