public function toArray($associative = true, $k = null)
	{
		$keys        = \func_get_args();
		$associative = array_shift($keys);

		if (empty($keys))
		{
			$keys = $this->getObjectsKeys();
		}

		$return = array();

		$i = 0;

		foreach ($this->objects as $key => $object)
		{
			$arrayItem = array();

			$key = ($associative) ? $key : $i++;

			$j = 0;

			foreach ($keys as $property)
			{
				$propertyKey             = ($associative) ? $property : $j++;
				$arrayItem[$propertyKey] = (isset($object->$property)) ? $object->$property : null;
			}

			$return[$key] = $arrayItem;
		}

		return $return;
	}
public function toArray($associative = true, $k = null)
	{
		$keys        = \func_get_args();
		$associative = array_shift($keys);

		if (empty($keys))
		{
			$keys = $this->getObjectsKeys();
		}

		$return = array();

		$i = 0;

		foreach ($this->objects as $key => $object)
		{
			$arrayItem = array();

			$key = ($associative) ? $key : $i++;

			$j = 0;

			foreach ($keys as $property)
			{
				$propertyKey             = ($associative) ? $property : $j++;
				$arrayItem[$propertyKey] = (isset($object->$property)) ? $object->$property : null;
			}

			$return[$key] = $arrayItem;
		}

		return $return;
	}
public function toArray ( $ associative = true , $ k = null ) { $ keys = \ func_get_args ( ) ; $ associative = array_shift ( $ keys ) ; if ( empty ( $ keys ) ) { $ keys = $ this -> getObjectsKeys ( ) ; } $ return = array ( ) ; $ i = 0 ; foreach ( $ this -> objects as $ key => $ object ) { $ arrayItem = array ( ) ; $ key = ( $ associative ) ? $ key : $ i ++ ; $ j = 0 ; foreach ( $ keys as $ property ) { $ propertyKey = ( $ associative ) ? $ property : $ j ++ ; $ arrayItem [ $ propertyKey ] = ( isset ( $ object -> $ property ) ) ? $ object -> $ property : null ; } $ return [ $ key ] = $ arrayItem ; } return $ return ; }
Gets all objects as an array

@param   boolean  $associative  Option to set return mode: associative or numeric array.
@param   string   $k            Unlimited optional property names to extract from objects.

@return  array    Returns an array according to defined options.

@since   1.2.0
Gets all objects as an array