/** * Change base template from decorator and request data * * @param array $template - template provided from create function */ protected function input($template = array()) { $_this = $this->_decorator = $this->getInstance('decorator', 'bDecorator'); $this->_request = $this->getInstance('request', 'bRequest'); $this->_db = $this->getInstance('db', 'bDocumentation__bDataMapper'); // Decor template $decorTemplate = $_this->getData($template); $requestTemplate = $this->_request->get('blib') === __CLASS__ ? array('id' => $this->_request->get('id'), 'ajax' => $this->_request->get('ajax')) : array(); $this->_template = array_replace_recursive($this->_template, $decorTemplate, $requestTemplate); }
/** * @param array $data - get request data */ protected function input($data = array()) { $this->_request = $this->getInstance('request', 'bRequest'); $this->_db = $this->getInstance('db', 'bAnnounces__bDataMapper'); $this->_decorator = $this->getInstance('decorator', 'bDecorator'); $this->_converter = $this->getInstance('converter', 'bConverter'); $tunnel = (array) $this->_request->get(__CLASS__); $request = array('count' => $this->_request->get('count'), 'limit' => $this->_request->get('limit')); // Glue request params $this->_mvc = array_replace($this->_mvc, $request, $tunnel, $data); }
/** * stores the data * @return none */ function saveCapabilities() { $table =& bTable::getInstance($this->table, 'Table'); $table->load(bRequest::getVar('role')); $table->setCapabilities(bRequest::get('get')); print_r($table->getProperties()); $table->store(); echo 'Item Saved!'; }
/** * stores the data * @return none */ function save() { $table =& bTable::getInstance($this->table, 'Table'); if (!$table->bind(bRequest::get('get'))) { return trigger_error($table->getError()); } $table->store(); echo 'Item Saved!'; }
/** * Get property from [set data]->[tunnel data]->[request data]->[some default value]->null (use this order) * * @param string $name - property name * @param null $default - default value * @return mixed|null - property value */ protected final function get($name = '', $default = null) { $tunnel = (array) $this->_request->get(get_class($this)); $request = $this->_request->get($name, $default); return isset($tunnel[$name]) ? $tunnel[$name] : $request; }