Setter for $search callable function

@param $function
@return $this
556121
public function setSearch($function)
    {
        if (is_string($function)) {

            $field = $function;
            $function = function (Table $table, $query) use ($field) {

                // verify that source is a query
                if (!$this->isSourceQueryBuilder()) {
                    throw new \Exception('Table source is not an instance of query builder');
                }

                $table->getSource()->where($field, 'LIKE', $query . '%');
            };
        }

        if (!is_callable($function)) {
            throw new InvalidArgumentException('Search function is not callable');
        }

        $this->search = $function;
        return $this;
    }
1106039
public function setTarget($js_func)
    {
        $this->on('click', 'a')->univ()->frameURL($this->js()->_selectorThis()->attr('href'));

        return $this;
    }
234792
def get_functions_by_search(self, function_query, function_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_functions_by_search(function_query, function_search)
608491
public function whereSearch($search)
    {
        if(!empty($search)){
            $this->andFilterWhere([
                'OR',
                ['LIKE', static::getTableNameItem() . '.title', $search],
                [static::getTableNameItem() . '.id' => $search],
                ['LIKE', static::getTableNameItem() . '.description', $search],
            ]);
        }
        return $this;
    }
2310
public function byFunction(
        string $function,
        string $order
    ): SortBy {
        $this->sortsBy[] = [
            'type' => self::TYPE_FUNCTION,
            'function' => $function,
            'order' => $order,
        ];

        return $this;
    }
1145034
public function setDefaultSearch( $search )
    {
        $this->defaultSearch = array();

        foreach ( $search as $column => $spec )
        {
            $this->defaultSearch[$column] = $spec;
        }

        return $this;
    }
789701
public function setAppendFormFieldsFunction(callable $function)
    {
        $validator = $this->getCallableValidatorAppendFormFields();
        $validator->setCallableFunction($function);

        if ($validator->isValid() === false) {
            throw $validator->getException();
        }

        $this->appendFormFieldsFunction = $function;

        return $this;
    }
507085
public function addDisableFunctions($disabledFunction) {
        if ($this->searchParams->disableFunctions == null) {
            $this->searchParams->disableFunctions = array();
        }

        $this->searchParams->disableFunctions[] = $disabledFunction;
    }
541921
public function filter(callable $fn)
    {
        $this->items = array_values(array_filter($this->items, $fn));

        return $this;
    }
1344348
public function setQuery($query)
    {
        $this->query = $query;
        parse_str($this->query, $this->query_array);
        return $this;
    }
650403
public function setConvertValueFunction(callable $function)
    {
        $validator = $this->getCallableValidatorConvertValue();
        $validator->setCallableFunction($function);

        if ($validator->isValid() === false) {
            throw $validator->getException();
        }

        $this->convertValueFunction = $function;

        return $this;
    }
983241
public function setEditableRowCallback($callback)
    {
        $this->isEditable() ?: $this->setEditable();
        $this->editableRowCallback = $callback;

        return $this;
    }
4776
protected function sqlFunction(SQLFunction $function) {
		//connect to database
		$this->mapper->connect();
	
		//build query
		$query = $this->mapper->newQuery($this->entityProfile)
		->from($this->entityProfile->getEntityTable(), Schema::DEFAULT_ALIAS)
		->select($function->getFunctionInstance());
	
		//set query condition
		if ($this->hasOption('query.filter'))
			$query->where($this->getFilter());
	
		list($sql, $args) = $query->build();
		return $this->mapper->merge($this->clean(['map.type' => $function->getDefaultType()]))->execute($sql, $args);
	}
863862
function each (callable $fn)
  {
    foreach ($this->getIterator () as $k => $v)
      if ($fn ($v, $k) === false) break;
    return $this;
  }
1139839
public function setCallback($object, $callbackFunction, $parameters = array())
    {
        $this->callbackObject = $object;

        $this->callbackFunction = $callbackFunction;

        $this->callbackParameters = $parameters;

        return $this;
    }
1154040
public function subscribe(callable $func): self
    {
        $this->handle->subscribe([$this->name], $func);
        return $this;
    }
1238907
public function map(callable $func = null): self
    {
        if (null === $func) {
            return $this;
        }

        return parent::map($func);
    }