public function getObjectsKeys($type = 'all')
	{
		$keys = null;

		if ($type == 'all')
		{
			$function = 'array_merge';
		}
		elseif ($type == 'common')
		{
			$function = 'array_intersect_key';
		}
		else
		{
			throw new \InvalidArgumentException("Unknown selection type: $type");
		}

		foreach ($this->objects as $object)
		{
			if (version_compare(PHP_VERSION, '5.4.0', '<'))
			{
				$objectVars = json_decode(json_encode($object->jsonSerialize()), true);
			}
			else
			{
				$objectVars = json_decode(json_encode($object), true);
			}

			$keys = ($keys === null) ? $objectVars : $function($keys, $objectVars);
		}

		return array_keys($keys);
	}
public function getObjectsKeys($type = 'all')
	{
		$keys = null;

		if ($type == 'all')
		{
			$function = 'array_merge';
		}
		elseif ($type == 'common')
		{
			$function = 'array_intersect_key';
		}
		else
		{
			throw new \InvalidArgumentException("Unknown selection type: $type");
		}

		foreach ($this->objects as $object)
		{
			if (version_compare(PHP_VERSION, '5.4.0', '<'))
			{
				$objectVars = json_decode(json_encode($object->jsonSerialize()), true);
			}
			else
			{
				$objectVars = json_decode(json_encode($object), true);
			}

			$keys = ($keys === null) ? $objectVars : $function($keys, $objectVars);
		}

		return array_keys($keys);
	}
public function getObjectsKeys ( $ type = 'all' ) { $ keys = null ; if ( $ type == 'all' ) { $ function = 'array_merge' ; } elseif ( $ type == 'common' ) { $ function = 'array_intersect_key' ; } else { throw new \ InvalidArgumentException ( "Unknown selection type: $type" ) ; } foreach ( $ this -> objects as $ object ) { if ( version_compare ( PHP_VERSION , '5.4.0' , '<' ) ) { $ objectVars = json_decode ( json_encode ( $ object -> jsonSerialize ( ) ) , true ) ; } else { $ objectVars = json_decode ( json_encode ( $ object ) , true ) ; } $ keys = ( $ keys === null ) ? $ objectVars : $ function ( $ keys , $ objectVars ) ; } return array_keys ( $ keys ) ; }
Gets an array of keys, existing in objects

@param   string  $type  Selection type 'all' or 'common'

@return  array   Array of keys

@since   1.2.0
@throws  \InvalidArgumentException
Gets an array of keys existing in objects