Пример #1
0
 /**
  * @return \PHPCrystal\PHPCrystal\Component\Package\AbstractApplication
  */
 public function getApplication()
 {
     return AbstractFacade::getApplication();
 }
Пример #2
0
 /**
  * Returns a package instance by the name of one of its classes
  * 
  * @return \PHPCrystal\PHPCrystal\Component\Package\AbstractPackage
  */
 public function getPackageByItsMember($mixed)
 {
     $className = is_object($mixed) ? get_class($mixed) : $mixed;
     $parts = explode('\\', $className);
     $pkgNamespace = $parts[0] . '\\' . $parts[1];
     foreach (Facade\AbstractFacade::getApplication()->getExtensions(true) as $pkg) {
         if ($pkgNamespace == $pkg->getNamespace()) {
             return $pkg;
         }
     }
 }