public static function createResource(App_Acl $acl, $resource) { $inherit = null; $parts = explode('<', $resource); $parts = array_filter(array_map('trim', $parts)); $resource = $parts[0]; if (!empty($parts[1])) { $inherit = $parts[1]; } $acl->addResource($resource, $inherit); }
public static function createResource(App_Acl $acl, $resource) { $inherit = null; if (is_object($resource)) { if (!isset($resource->name)) { throw new InvalidArgumentException("No resource name"); } if (isset($resource->inherit)) { $inherit = $resource->inherit; } $resource = $resource->name; } $acl->addResource($resource, $inherit); }