protected static function _finders() {
		$self = static::_object();

		return [
			'all' => function($params, $next) {
				return $next($params);
			},
			'first' => function($params, $next) {
				$options =& $params['options'];
				$options['limit'] = 1;

				$data = $next($params);

				if (isset($options['return']) && $options['return'] === 'array') {
					$data = is_array($data) ? reset($data) : $data;
				} else {
					$data = is_object($data) ? $data->rewind() : $data;
				}
				return $data ?: null;
			},
			'list' => function($params, $next) use ($self) {
				$result = [];
				$meta = $self::meta();
				$name = $meta['key'];

				foreach ($next($params) as $entity) {
					$key = $entity->{$name};
					$result[is_scalar($key) ? $key : (string) $key] = $entity->title();
				}
				return $result;
			},
			'count' => function($params, $next) use ($self) {
				$options = array_diff_key($params['options'], $self->_query);

				if ($options && !isset($params['options']['conditions'])) {
					$options = ['conditions' => $options];
				} else {
					$options = $params['options'];
				}
				$options += ['type' => 'read', 'model' => $self];
				$query = $self::invokeMethod('_instance', ['query', $options]);
				return $self::connection()->calculation('count', $query, $options);
			}
		];
	}
protected static function _finders() {
		$self = static::_object();

		return [
			'all' => function($params, $next) {
				return $next($params);
			},
			'first' => function($params, $next) {
				$options =& $params['options'];
				$options['limit'] = 1;

				$data = $next($params);

				if (isset($options['return']) && $options['return'] === 'array') {
					$data = is_array($data) ? reset($data) : $data;
				} else {
					$data = is_object($data) ? $data->rewind() : $data;
				}
				return $data ?: null;
			},
			'list' => function($params, $next) use ($self) {
				$result = [];
				$meta = $self::meta();
				$name = $meta['key'];

				foreach ($next($params) as $entity) {
					$key = $entity->{$name};
					$result[is_scalar($key) ? $key : (string) $key] = $entity->title();
				}
				return $result;
			},
			'count' => function($params, $next) use ($self) {
				$options = array_diff_key($params['options'], $self->_query);

				if ($options && !isset($params['options']['conditions'])) {
					$options = ['conditions' => $options];
				} else {
					$options = $params['options'];
				}
				$options += ['type' => 'read', 'model' => $self];
				$query = $self::invokeMethod('_instance', ['query', $options]);
				return $self::connection()->calculation('count', $query, $options);
			}
		];
	}
protected static function _finders ( ) { $ self = static :: _object ( ) ; return [ 'all' => function ( $ params , $ next ) { return $ next ( $ params ) ; } , 'first' => function ( $ params , $ next ) { $ options = & $ params [ 'options' ] ; $ options [ 'limit' ] = 1 ; $ data = $ next ( $ params ) ; if ( isset ( $ options [ 'return' ] ) && $ options [ 'return' ] === 'array' ) { $ data = is_array ( $ data ) ? reset ( $ data ) : $ data ; } else { $ data = is_object ( $ data ) ? $ data -> rewind ( ) : $ data ; } return $ data ? : null ; } , 'list' => function ( $ params , $ next ) use ( $ self ) { $ result = [ ] ; $ meta = $ self :: meta ( ) ; $ name = $ meta [ 'key' ] ; foreach ( $ next ( $ params ) as $ entity ) { $ key = $ entity -> { $ name } ; $ result [ is_scalar ( $ key ) ? $ key : ( string ) $ key ] = $ entity -> title ( ) ; } return $ result ; } , 'count' => function ( $ params , $ next ) use ( $ self ) { $ options = array_diff_key ( $ params [ 'options' ] , $ self -> _query ) ; if ( $ options && ! isset ( $ params [ 'options' ] [ 'conditions' ] ) ) { $ options = [ 'conditions' => $ options ] ; } else { $ options = $ params [ 'options' ] ; } $ options += [ 'type' => 'read' , 'model' => $ self ] ; $ query = $ self :: invokeMethod ( '_instance' , [ 'query' , $ options ] ) ; return $ self :: connection ( ) -> calculation ( 'count' , $ query , $ options ) ; } ] ; }
Returns an array with the default finders.

@see lithium\data\Model::_initialize()
@return array
Returns an array with the default finders .