Gets or sets a finder by name. This can be an array of default query options, or a closure that accepts an array of query options, and a closure to execute.

Parameters

  • string $name The finder name, e.g. `first`.
  • string $options If you are setting a finder, this is the finder definition.

Returns

mixed Finder definition if querying, null otherwise.

Source

						public static function finder($name, $options = null) {
		$self = static::_object();

		if (empty($options)) {
			return isset($self->_finders[$name]) ? $self->_finders[$name] : null;
		}
		$self->_finders[$name] = $options;
	}