Esempio n. 1
0
 protected function load($avID)
 {
     $db = Loader::db();
     //        $row = $db->GetRow('select avID, akID, uID, avDateAdded, atID from AttributeValues where avID = ?', array($avID));
     $row = $db->GetRow('select avID, akID from AttributeValues where avID = ?', array($avID));
     if (is_array($row) && $row['avID'] == $avID) {
         $this->setPropertiesFromArray($row);
         $this->attributeKey = Key::getByID($row['akID']);
         $this->attributeType = $this->getAttributeTypeObject();
     }
 }
Esempio n. 2
0
 public function dispatch($action)
 {
     $arguments = explode('/', trim($action, '/'));
     if (count($arguments) > 2) {
         // there must at last be three arguments here
         if (isset($arguments[0])) {
             switch ($arguments[0]) {
                 case 'key':
                     if (isset($arguments[1])) {
                         $key = Key::getByID($arguments[1]);
                         if (is_object($key)) {
                             $controller = $key->getController();
                         }
                     }
                     break;
                 case 'type':
                     if (isset($arguments[1])) {
                         $type = Type::getByID($arguments[1]);
                         if (is_object($type)) {
                             $controller = $type->getController();
                         }
                     }
                     break;
             }
         }
         if (isset($controller)) {
             $action = $arguments[2];
             $arguments = array_slice($arguments, 3);
             if (method_exists($controller, 'action_' . $action)) {
                 //make sure the controller has the right method
                 $response = call_user_func_array(array($controller, 'action_' . $action), $arguments);
                 if ($response instanceof Response) {
                     return $response;
                 } else {
                     print $response;
                     $this->app->shutdown();
                 }
             }
         }
     }
     $response = new Response(t('Access Denied'));
     return $response;
 }
 public function __wakeup()
 {
     $this->attributeKey = \Concrete\Core\Attribute\Key\Key::getByID($this->akID);
 }