public function current() {

		$current = parent :: current();

		if(null !== $current) {

			if(false === is_string($current) && false === is_numeric($current) && true === $this -> is_multidimensional($current)) {

				if($this -> convert !== self :: TYPE_ARRAY) {
					return trigger_error(sprintf('Multidimensional Array can not be converted to "%s" type in "%s"', $this -> convert, __METHOD__), E_USER_ERROR);	
				}

				return $current;
			}

			switch($this -> convert) {

				case self :: TYPE_ARRAY: 
					return $current;

				case self :: TYPE_OBJECT: 
					return (object) $current;

				case self :: TYPE_JSON: 
					return json_encode($current);

				default : 

					if(false === class_exists($this -> entity)) {
						return trigger_error(sprintf('"%s" is not a valid type or Entity class file in %s', $type, __METHOD__), E_USER_ERROR);
					}

					$entity = new $this -> entity();

					$entity -> setAdapter($this -> adapter);
					$entity -> fromArray($current);

					return $entity;
			}
		}
	}
public function current() {

		$current = parent :: current();

		if(null !== $current) {

			if(false === is_string($current) && false === is_numeric($current) && true === $this -> is_multidimensional($current)) {

				if($this -> convert !== self :: TYPE_ARRAY) {
					return trigger_error(sprintf('Multidimensional Array can not be converted to "%s" type in "%s"', $this -> convert, __METHOD__), E_USER_ERROR);	
				}

				return $current;
			}

			switch($this -> convert) {

				case self :: TYPE_ARRAY: 
					return $current;

				case self :: TYPE_OBJECT: 
					return (object) $current;

				case self :: TYPE_JSON: 
					return json_encode($current);

				default : 

					if(false === class_exists($this -> entity)) {
						return trigger_error(sprintf('"%s" is not a valid type or Entity class file in %s', $type, __METHOD__), E_USER_ERROR);
					}

					$entity = new $this -> entity();

					$entity -> setAdapter($this -> adapter);
					$entity -> fromArray($current);

					return $entity;
			}
		}
	}
public function current ( ) { $ current = parent :: current ( ) ; if ( null !== $ current ) { if ( false === is_string ( $ current ) && false === is_numeric ( $ current ) && true === $ this -> is_multidimensional ( $ current ) ) { if ( $ this -> convert !== self :: TYPE_ARRAY ) { return trigger_error ( sprintf ( 'Multidimensional Array can not be converted to "%s" type in "%s"' , $ this -> convert , __METHOD__ ) , E_USER_ERROR ) ; } return $ current ; } switch ( $ this -> convert ) { case self :: TYPE_ARRAY : return $ current ; case self :: TYPE_OBJECT : return ( object ) $ current ; case self :: TYPE_JSON : return json_encode ( $ current ) ; default : if ( false === class_exists ( $ this -> entity ) ) { return trigger_error ( sprintf ( '"%s" is not a valid type or Entity class file in %s' , $ type , __METHOD__ ) , E_USER_ERROR ) ; } $ entity = new $ this -> entity ( ) ; $ entity -> setAdapter ( $ this -> adapter ) ; $ entity -> fromArray ( $ current ) ; return $ entity ; } } }
Converts current array element to entity when requested
@return mixed
Converts current array element to entity when requested