public static QueryBase::getNamespaces($object)
Gets a list of namespaces of the ancestors of a class.
$object: An object within a namespace.
array A list containing the namespace of the class, the namespace of the parent of the class and so on and so on.
public static function getNamespaces($object) { $namespaces = array(); for ($class = get_class($object); $class; $class = get_parent_class($class)) { $namespaces[] = substr($class, 0, strrpos($class, '\\')); } return $namespaces; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!Query!QueryBase.php/function/QueryBase::getNamespaces/8.1.x