/** * Get all records for the current key from the session. * * @return array */ private function getRecordsFromSession() { return SessionStore::getInstance($this->_key)->getData(); }
/** * Delete the database in the session. * * @return bool Results, true or false */ protected function _doDeleteSession() { $selector = Tools::atkArrayNvl($this->m_postvars, 'atkselector', ''); return SessionStore::getInstance()->deleteDataRowForSelector($selector); }
/** * Persist records from the session (in add mode) to the database. * * @param Db $db * @param array $record * @param string $mode * * @return bool */ private function storeAdd($db, $record, $mode) { if (!$this->createDestination()) { return false; } $rows = SessionStore::getInstance($this->getSessionStoreKey())->getData(); foreach ($rows as $row) { $this->updateSessionAddFakeId($row, $this->getSessionAddFakeId(), $record); $this->m_destInstance->addDb($row); } // after saving the rows, we can clear the sessionstore SessionStore::getInstance($this->getSessionStoreKey())->setData(null); return true; }
/** * Store a record in the session. * * @param array $record Record to store in the session * * @return bool Successfull save? */ protected function storeRecordInSession(&$record) { Tools::atkdebug('STORING RECORD IN SESSION'); $result = SessionStore::getInstance()->addDataRow($record, $this->m_node->primaryKeyField()); return $result !== false; }
/** * Get the current record from the database with the current selector. * * @return array */ protected function getRecordFromSession() { $selector = Tools::atkArrayNvl($this->m_node->m_postvars, 'atkselector', ''); return SessionStore::getInstance()->getDataRowForSelector($selector); }
/** * Update a record in the session. * * @param array $record Record to update * * @return mixed Result of the update, true or false */ private function updateRecordInSession($record) { $selector = Tools::atkArrayNvl($this->m_postvars, 'atkselector', ''); return SessionStore::getInstance()->updateDataRowForSelector($selector, $record) !== false; }