src/DB/PDO/Table.php
public function getByIndices( $indices, $orders = array(), $fields = array(), $strict = FALSE ){
		if( is_string( $fields ) )
			$fields	= strlen( trim( $fields ) ) ? array( trim( $fields ) ) : array();
		if( !is_array( $fields ) )
			throw new \InvalidArgumentException( 'Fields must be of array or string' );
		foreach( $fields as $field )
			$field	= $this->checkField( $field, FALSE, TRUE );
		$this->checkIndices( $indices, TRUE, TRUE );
		foreach( $indices as $key => $value )
			$this->table->focusIndex( $key, $value );
		$result	= $this->table->get( TRUE, $orders );
		$this->table->defocus();
		return $this->getFieldsFromResult( $result, $fields, $strict );
	}
public function getByIndices( $indices, $orders = array(), $fields = array(), $strict = FALSE ){
		if( is_string( $fields ) )
			$fields	= strlen( trim( $fields ) ) ? array( trim( $fields ) ) : array();
		if( !is_array( $fields ) )
			throw new \InvalidArgumentException( 'Fields must be of array or string' );
		foreach( $fields as $field )
			$field	= $this->checkField( $field, FALSE, TRUE );
		$this->checkIndices( $indices, TRUE, TRUE );
		foreach( $indices as $key => $value )
			$this->table->focusIndex( $key, $value );
		$result	= $this->table->get( TRUE, $orders );
		$this->table->defocus();
		return $this->getFieldsFromResult( $result, $fields, $strict );
	}
public function getByIndices ( $ indices , $ orders = array ( ) , $ fields = array ( ) , $ strict = FALSE ) { if ( is_string ( $ fields ) ) $ fields = strlen ( trim ( $ fields ) ) ? array ( trim ( $ fields ) ) : array ( ) ; if ( ! is_array ( $ fields ) ) throw new \ InvalidArgumentException ( 'Fields must be of array or string' ) ; foreach ( $ fields as $ field ) $ field = $ this -> checkField ( $ field , FALSE , TRUE ) ; $ this -> checkIndices ( $ indices , TRUE , TRUE ) ; foreach ( $ indices as $ key => $ value ) $ this -> table -> focusIndex ( $ key , $ value ) ; $ result = $ this -> table -> get ( TRUE , $ orders ) ; $ this -> table -> defocus ( ) ; return $ this -> getFieldsFromResult ( $ result , $ fields , $ strict ) ; }
Returns data of single line selected by indices.
@access		public
@param		array			$indices		Map of Index Keys and Values
@param		array			$orders			Map of Orders to include in SQL Query
@param		string			$fields			List of fields or one field to return from result
@param		boolean			$strict			Flag: throw exception if result is empty (default: FALSE)
@return		mixed			Structure depending on fetch type, string if field selected, NULL if field selected and no entries
@throws		InvalidArgumentException			If given fields list is neither a list nor a string
@todo  		change default value of argument 'strict' to TRUE
Returns data of single line selected by indices .