Example #1
0
 public function __get($property)
 {
     switch ($property) {
         case 'extensions':
             return $this->{$property};
     }
     return parent::__get($property);
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function __isset($property)
 {
     switch ($property) {
         case 'record':
         case 'selection':
             return isset($this->{$property});
     }
     return parent::__isset($property);
 }
Example #3
0
 /**
  * {@inheritdoc}
  */
 public function __isset($property)
 {
     switch ($property) {
         case 'query':
             return isset($this->request->query['filter']);
         case 'primary':
             return isset($this->{$property});
     }
     return parent::__isset($property);
 }
Example #4
0
 /**
  * Get a JTK tool.
  * @param string $toolName Tool name.
  * @return PartialJtkSnippet A partial JTK snippet that can be used to
  * configure the tool before outputting.
  * @throws \Exception If tool not found.
  */
 public function __get($toolName)
 {
     $tool = $this->getTool($toolName);
     if (!isset($tool)) {
         return parent::__get($toolName);
     }
     return new PartialJtkSnippet($tool, $tool->getObject());
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function __set($property, $value)
 {
     switch ($property) {
         case 'userModel':
         case 'loginRoute':
         case 'unauthorizedRoute':
         case 'ajaxRoute':
         case 'createSessions':
         case 'createCookies':
         case 'sessionPrefix':
         case 'sessionLifeTime':
         case 'sessionRenewAfter':
         case 'cookiePrefix':
         case 'cookieLifeTime':
         case 'cookieRenewAfter':
         case 'permissionPrefix':
             $this->{$property} = $value;
             return;
         case 'passwordHasher':
             if ($value instanceof PasswordHasher) {
                 $this->passwordHasher = $value;
             } else {
                 Assume::isSubclassOf($value, 'Jivoo\\AccessControl\\Passwordhasher');
                 $this->passwordHasher = new $value();
             }
             return;
         case 'authentication':
             if (is_array($value)) {
                 foreach ($value as $name => $options) {
                     if (!is_string($name)) {
                         $name = $options;
                         $options = array();
                     }
                     $this->loadAuthentication($name, $options);
                 }
             } else {
                 $this->loadAuthentication($value);
             }
             return;
         case 'authorization':
             if (is_array($value)) {
                 foreach ($value as $name => $options) {
                     if (!is_string($name)) {
                         $name = $options;
                         $options = array();
                     }
                     $this->loadAuthorization($name, $options);
                 }
             } else {
                 $this->loadAuthorization($value);
             }
             return;
         case 'acl':
             if (is_array($value)) {
                 foreach ($value as $name => $options) {
                     if (!is_string($name)) {
                         $name = $options;
                         $options = array();
                     }
                     $this->loadAcl($name, $options);
                 }
             } else {
                 $this->loadAcl($value);
             }
             return;
     }
     parent::__set($property, $value);
 }