/** * Delete all registered objects of the given class */ public function delete(DbObject $obj) { $class = $obj->getClass(true); if (isset($this->delete_register[$class])) { $this->delete_register[$class]->delete(); unset($this->delete_register[$class]); } }
public static function getKeyword($keyword) { //array_unique(array_merge($array1, $array2)); $dbObject = new DbObject(); $winnerArray = array("keyword" => $keyword, "itemIdScore" => array()); $finalWinnerArray = array("keyword" => $keyword, "itemIdScore" => array()); $days = $dbObject->query('select days_in_words, days_in_number, multiplication_factor from available_days'); $query = ""; foreach ($days as $key => $day) { $days[$day['days_in_number']] = $days[$key]; unset($days[$key]); $query .= 'select "' . $day["days_in_words"] . '" as days, ' . $day["days_in_number"] . ' as n_days, a.id, a.id_keyword,a.id_item_id,a.score from ' . $day["days_in_words"] . '_days_item_id_ae as a where a.id_keyword="' . $keyword . '" union '; } $query = substr($query, 0, count($query) - 7); $results = $dbObject->query($query); if (!is_null($results)) { foreach ($results as $result) { $score = $result['score'] * $days[$result['n_days']]['multiplication_factor']; array_push($winnerArray["itemIdScore"], array("itemId" => $result["id_item_id"], "score" => $score)); } $winnerArrayLength = count($winnerArray['itemIdScore']); $pointer = 0; $matched = false; //while(isset($winnerArray['itemIdScore'][$pointer])){ $itemcount = count($winnerArray['itemIdScore']); while ($itemcount > $pointer) { if (!isset($winnerArray['itemIdScore'][$pointer]['itemId'])) { $pointer++; continue; } $finalScore = $winnerArray['itemIdScore'][$pointer]['score']; foreach ($winnerArray['itemIdScore'] as $key => $value) { if ($key != $pointer) { //for($i=$pointer; $i<$winnerArrayLength; $i++){ if ($value['itemId'] == $winnerArray['itemIdScore'][$pointer]['itemId']) { echo $value['itemId'] . " " . $winnerArray['itemIdScore'][$pointer]['itemId'] . '\\n]'; $finalScore = $winnerArray['itemIdScore'][$key]['score'] + $finalScore; //array_push($finalWinnerArray["itemIdScore"], array("itemId" => $value['itemId'], "score" => $finalScore)); $matched = array("itemId" => $value['itemId'], "score" => $finalScore); unset($winnerArray['itemIdScore'][$key]); } } } if ($matched === false) { array_push($finalWinnerArray["itemIdScore"], $matched); $matched = false; } array_push($finalWinnerArray["itemIdScore"], array("itemId" => $winnerArray['itemIdScore'][$pointer]['itemId'], "score" => $finalScore)); unset($winnerArray['itemIdScore'][$pointer]); $pointer++; } } var_dump($finalWinnerArray); return; return json_encode($winnerArray); }
function checkResetID() { if (isset($_GET['resetid'])) { $db = new DbObject(); $resUser = $db->select("username", "Member", 'resetID="' . $_GET['resetid'] . '"'); $username = getUsername($resUser); return $username; } else { return false; } }
/** * Delete all objects * * This creates a single delete query using the complete keys of * each of the dbobjects that has been registered */ function delete() { if (count($this->dbobjects) && is_array($this->dbobjects)) { $clause = new Clause(); $class_name = $this->class_name; $obj = new $class_name(); DbObject::cascadeDelete($this->dbobjects); foreach ($this->dbobjects as $dbobj) { /**$sub_clause = new Clause(); foreach($dbobj->primaryKeys() as $field) { $sub_clause->addTableCondition($obj->tableName(),$field->name(),$field->value()); }*/ if ($dbobj->db_clause) { $clause->addSubClause($dbobj->db_clause, Clause::OR_REL, Clause::LAST); } else { $clause->addSubClause($dbobj->uniqueClause(), Clause::OR_REL, Clause::LAST); } } $query = new DeleteQuery($obj->tableName()); $query->setClause($clause); Session::unRegister($this->class_name . '_rel_deleteregister'); $query->doQuery(); } }
public function pageData($p, $z) { header('Content-type: text/xml'); $this->layout = 'plain'; $entries = DbObject::_find('Entry'); $this->assign('entries', $entries); }
public function __construct($id = null) { parent::__construct(); if (!is_null($id)) { $this->getById($id); } }
public function pageList($p, $z) { $table = DbObject::_getTableSchema($this->class); $objects = DbObject::_find($this->class, $this->conditions, array('orderby' => $this->orderby . ', id')); $this->assign('table', $table); $this->assign('objects', $objects); }
static function getItemIdScore($keyword) { $orderScore = $visitScore = $productViewsScore = $cartsScore = 0; $dbObject = new DbObject(); $winnerArray = array("keyword" => $keyword, "itemIdScore" => array()); //array("subCategory"=>"Dress", "score"=>4.3), array("subCategory"=>"Top", "score"=>3.2) $query = 'select k.value, b.value, tdbae.orders, tdbae.visits, tdbae.product_views, tdbae.carts from three_days_item_id_ae as tdbae left join brand as b on b.id = tdbae.id_brand left join keyword as k on k.id = tdbae.id_keyword where k.value="' . $keyword . '"'; $results = $dbObject->query($query); $keywordResult = $dbObject->query('select * from keyword where value="' . $keyword . '"'); if (!is_null($results)) { foreach ($results as $result) { if ($keywordResult[0]['orders'] != 0) { $orderScore = $result['orders'] / $keywordResult[0]['orders']; } if ($keywordResult[0]['visits'] != 0) { $visitScore = $result['visits'] / $keywordResult[0]['visits']; } if ($keywordResult[0]['product_views'] != 0) { $productViewsScore = $result['product_views'] / $keywordResult[0]['product_views']; } if ($keywordResult[0]['carts'] != 0) { $cartsScore = $result['carts'] / $keywordResult[0]['carts']; } //var_dump($orderScore, $visitScore, $productViewsScore, $cartsScore);echo "now powers"; if ($visitScore > 0.01) { $score = $orderScore + $visitScore + $productViewsScore + $cartsScore; array_push($winnerArray["brandScore"], array("brand" => $result["value"], "score" => $score)); } } } return json_encode($winnerArray); }
public function pageListBody($p, $z) { $where = Filter::jsonToSql($_GET['filterData']); $sql = "SELECT\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\trequest\n\t\t\t\twhere\n\t\t\t\t\t{$where}"; $requests = DbObject::_findBySql('request', $sql, array()); $this->assign('requests', $requests); $this->layout = false; $this->display('list_body'); }
public function getPermittedRequests() { if ($this->id == self::rootId) { $requests = DbObject::_find('Request', NULL, array('orderby' => 'id')); } else { $requests = $this->request; } return $requests; }
public function postLogin($p, $z) { $user = DbObject::_findOne('Person', array('username' => $_POST['username'], 'password' => $_POST['password'])); if ($user) { $_SESSION['personId'] = $user->id; session::saveChangesUnsafe(); } Redirect($_SERVER['HTTP_REFERER']); }
function insert() { DbObject::insert(); if ($children = $this->getChildren()) { foreach ($children as $child) { $child->set('parent_id', $this->id()); } } }
public function get($field) { $ret = DbObject::get($field); if(($field == 'entry_date') && ($date_format = Logbook::current()->entryDateFormat())) $ret = date($date_format,strtotime($ret)); return $ret; }
public function insert($force_validation = true) { if (empty($this->bend_workperiod_id)) { $wp = $this->Bend->getWorkPeriodForDate($this->d2Time($this->d_date)); if (!empty($wp)) { $this->bend_workperiod_id = $wp->id; } } parent::insert($force_validation); }
public function getInfo() { if (!$this->owner) { $remoteTableName = DbObject::_getTableName($this->remoteClassName); $sql = "select * from {$remoteTableName} where {$this->remoteFieldName} = :id:int"; $row = $this->dbObject->getDb()->fetchRow($sql, array($this->remoteFieldName => $this->dbObject->getField($this->localFieldName))); $this->owner = new $this->remoteClassName($row); } return $this->owner; }
public function page1($p, $z) { $year = $p[1]; $month = $p[2]; $day = $p[3]; $name = $p[4]; $date = "{$year}-{$month}-{$day}"; $entry = DbObject::_findOne('Entry', array('published_date' => $date, 'name' => $name)); $this->assign('isList', false); $this->assign('entry', $entry); }
function sendMail($username) { $db = new DbObject(); // <a href='doReset.php?resetid= . $randString' >Click Here to Reset Password</a> //generates random string and stores it in a variable $randString = getToken(); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Classified Staff <*****@*****.**>' . "\r\n"; // get the folder name where the reset file is contained $folder = dirname($_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $message = "\r\n <html>\r\n <head>\r\n <title>Reset Password</title>\r\n </head>\r\n <body>\r\n <div> \r\n <p>Hello {$username}</p>\r\n <p>Please click the link below to reset your password\r</p>\r\n <a href='https://" . $folder . "/doReset.php?resetid={$randString}' >Click Here to Reset Password</a>\r\n \r\n <br />\r\n\r\n <p>Replies to this email will not be delivered.</p>\r\n </div>\r\n </body>\r\n </html>\r\n "; //manage the email's length $message = wordwrap($message, 140, "\r\n"); // Add the reset id to the member's $rIdArray = array("resetID" => $randString, "username" => $username); $db->update($rIdArray, "Member", "username"); // mail returns a boolean indicating the success or delivery of mail return mail('cst211@cst.siast.sk.ca ', 'Classified: Password Reset', $message, $headers); }
/** * Purpose: Add a user into the password list * @param string $username The username to add * @param string $password The password associated with the username * @return boolean TRUE if the user was successfully added, * FALSE otherwise */ public function addUser($username, $password, $email, $qst1, $qst1Answer, $qst2, $qst2Answer) { // Open a database connection $db = new DbObject(); // Create the array to use with the insert method $memberRecord["username"] = $username; $memberRecord["email"] = $email; $memberRecord["password"] = password_hash($password, PASSWORD_DEFAULT); $qst1Record["question"] = $qst1; $qst1Record["answer"] = $qst1Answer; $qst1Record["username"] = $username; $qst2Record["question"] = $qst2; $qst2Record["answer"] = $qst2Answer; $qst2Record["username"] = $username; // Insert the user into the Password database $memberNumRows = $db->insert($memberRecord, "Member"); $qst1NumRows = $db->insert($qst1Record, "ChallengeQuestion"); $qst2NumRows = $db->insert($qst2Record, "ChallengeQuestion"); return $memberNumRows == 1 && $qst1NumRows == 1 && $qst2NumRows == 1; }
function __construct($init) { parent::__construct($init); $this->cells = array(); for ($row = 1; $row <= self::size; $row++) { $this->cells[$row] = array(); for ($col = 1; $col <= self::size; $col++) { $this->cells[$row][$col] = new Cell(); } } }
public function pageDestroy() { // you shouldn't really do stuff like this in a page function $all = DbObject::_find('PersonStuff'); foreach ($all as $thisObject) { $thisObject->destroy(); } $all = DbObject::_find('GuidPerson'); foreach ($all as $thisObject) { $thisObject->destroy(); } }
public function getInfo() { if (!$this->theMany) { $remoteTable = DbObject::_getTableName($this->remoteClass); $sql = "select * from {$remoteTable} \n\t\t\t\t\tinner join {$this->joinTable} on {$this->joinTable}.{$this->joinTableRemoteField} = {$remoteTable}.{$this->remoteField}\n\t\t\t\t\twhere {$this->joinTable}.{$this->joinTableLocalField} = :id:int"; $rows = SqlFetchRows($sql, array('id' => $this->dbObject->getScalar($this->localField))); $this->theMany = array(); foreach ($rows as $thisRow) { $this->theMany[] = new $className($thisRow); } } return $this->theMany; }
public function getInfo() { if (!$this->theOneIsSet) { $remoteTableName = DbObject::_getTableName($this->remoteClassName); $sql = "select * from {$remoteTableName} where {$this->remoteFieldName} = :id:int"; $row = SqlFetchRow($sql, array('id' => $this->dbObject->getField($this->localFieldName))); if ($row) { $this->theOne = new $this->remoteClassName($row); } $this->theOneIsSet = 1; } return $this->theOne; }
/** * Compresses generated dump file(s), deletes raw sql file(s) and closes all opened connection * * @return void * @access private * */ private function finalizeBackup() { //Compress all the files in the dump folder system('tar -cjf ' . $this->folderName . '.tar.gz -C ' . $this->folderName . ' .'); //Delete nested files and directories (Leave the compressed file only) $this->recursiveDirRemove($this->folderName); //Close DB Connection $this->dbObject->close(); //Transfer the compressed file to Amazon S3 storage (If asked to) if ($this->s3Enabled) { $this->transferToAmazon(); } }
function insert($force_validation = false) { // $this->dt_modified = time(); // Get mimetype if (empty($this->mimetype)) { $this->mimetype = $this->w->getMimetype(FILE_ROOT . "/" . $this->fullpath); } // $this->modifier_user_id = $this->w->Auth->user()->id; <-- why? $this->fullpath = str_replace(FILE_ROOT, "", $this->fullpath); // $this->filename = ($this->filename . getFileExtension($this->mimetype)); $this->is_deleted = 0; parent::insert($force_validation); $this->w->callHook("attachment", "attachment_added_" . $this->parent_table, $this); }
public function getInfo() { if (!$this->theMany) { $params = array(); $params['orderby'] = $this->params['orderBy']; $remoteTableName = DbObject::_getTableName($this->remoteClassName); $conditions = $this->params['conditions']; $conditions[$this->remoteFieldName] = $this->dbObject->getField($this->localFieldName); $selectInfo = DbConnection::generateSelectInfo($remoteTableName, '*', $conditions, $params); $rows = $this->dbObject->getDb()->fetchRows($selectInfo['sql'], $selectInfo['params']); $this->theMany = array(); foreach ($rows as $thisRow) { if ($this->params['mapField']) { $this->theMany[$thisRow[$this->params['mapField']]] = new $this->remoteClassName($thisRow); } else { $this->theMany[] = new $this->remoteClassName($thisRow); } } } return $this; }
date_default_timezone_set('Africa/Nairobi'); //mail variables $emailTo = ''; $replyTo = ''; $ccTo = ''; $currentDate = new DateTime(); //.. $expiryDate = new DateTime(); $transid = 0; $sign = ''; $days = 0; //SCRIPT main //-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. require_once "../classes/DbObject.php"; require_once '../PHPMailer/PHPMailerAutoload.php'; $db = new DbObject(); $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); //protocols $protocolQ = "SELECT * FROM protocol"; $protocolStmt = $db->prepare($protocolQ); $protocolStmt->execute(); while ($protocolRow = $protocolStmt->FetchObject()) { $proid = $protocolRow->protocol_id; $protocolTitle = $protocolRow->protocol_title; $protocolDesc = $protocolRow->protocol_desc; $accid = $protocolRow->account_id; $discontinue = $protocolRow->discontinue; //account $accountQ = "SELECT * FROM account WHERE account_id=" . $accid; $accountStmt = $db->prepare($accountQ); $accountStmt->execute();
function CanvasReport() { $db = new DbObject(); $db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); $sql = "SELECT a.*, p.* \n\t\t\tFROM account a \n\t\t\tJOIN protocol p WHERE a.account_id=p.account_id \n\t\t\tGROUP BY a.account_id"; $stmt = $db->prepare($sql); $stmt->execute(); $count = 0; //numbers the records echo ' <table style="font-size:12px" width="100%" cellpadding="0" cellspacing="0"> '; while ($row = $stmt->FetchObject()) { $count++; $accountid = $row->account_id; $title = $row->title; $othernames = $row->other_names; $surname = $row->surname; $username = $row->username; $email = $row->email_address; $accounttype = $row->account_type; echo ' <tr> <td style="border:1px solid pink" valign="top"><strong>' . $count . '.</strong><br></td> <td style="border:1px solid pink" valign="top" colspan="5"><strong>' . $title . ' ' . $othernames . ' ' . $surname . '</strong><br></td> </tr> '; $psql = "SELECT * FROM protocol \n\t\t\t\tWHERE account_id=" . $accountid; $pstmt = $db->prepare($psql); $pstmt->execute(); echo ' <tr> <td style="border:1px solid pink"></td> <td style="border:1px solid pink" colspan="5" style="border:1px solid pink"><strong>Protocols</strong><br></td> </tr> '; while ($prow = $pstmt->FetchObject()) { $proid = $prow->protocol_id; $protitle = $prow->protocol_title; $prodesc = $prow->protocol_desc; echo ' <tr> <td style="border:1px solid pink"></td> <td style="border:1px solid pink" colspan="2" valign="top"><strong>' . $protitle . '</strong><br></td> <td style="border:1px solid pink" colspan="3">' . $prodesc . '<br></td> </tr> '; $cosql = "SELECT a.*, c.account_id, c.protocol_id, p.protocol_id \n\t\t\t\t\tFROM account a JOIN co_investigator c \n\t\t\t\t\tON a.account_id=c.account_id \n\t\t\t\t\tJOIN protocol p \n\t\t\t\t\tON c.protocol_id=p.protocol_id \n\t\t\t\t\tAND p.protocol_id=" . $proid; $costmt = $db->prepare($cosql); $costmt->execute(); $cocount = 0; echo ' '; $transql = "SELECT * FROM protocol_transactions WHERE protocol_id=" . $proid; $transtmt = $db->prepare($transql); $transtmt->execute(); $trancount = 0; echo ' <tr> <td style="border:1px solid pink"></td> <td style="border:1px solid pink"></td> <td style="border:1px solid pink" width="10%"><strong>Subm. Dates</strong><br></td> <td style="border:1px solid pink"><strong>Approval Dates</strong><br></td> <td style="border:1px solid pink"><strong>Expiry Dates</strong><br></td> <td style="border:1px solid pink"><strong>Transaction Dates</strong><br></td> </td> </tr> '; while ($tranrow = $transtmt->FetchObject()) { $transid = $tranrow->transaction_id; $submissionDate = date_create($tranrow->submission_date); $approvalDate = date_create($tranrow->approval_date); $expiryDate = date_create($tranrow->expiry_date); $applicationStatus = $tranrow->application_status; $transactionDate = date_create($tranrow->transaction_date); $approved = $tranrow->approved; $trancount++; echo ' <tr> <td style="border:1px solid pink"></td> <td style="border:1px solid pink"></td> <td style="border:1px solid pink">' . date_format($submissionDate, 'jS F Y') . '<br></td> <td style="border:1px solid pink">' . date_format($approvalDate, 'jS F Y') . '<br></td> <td style="border:1px solid pink">' . date_format($expiryDate, 'jS F Y') . '<br></td> <td style="border:1px solid pink">' . date_format($transactionDate, 'jS F Y') . '<br></td> </td> </tr> '; } echo ' <tr> <td style="border:1px solid pink"></td> <td style="border:1px solid pink" colspan="2" valign="top"></td> <td colspan="3"> '; echo ' <table width="100%" style="font-size:12px" cellpadding="0" cellspacing="0"> <tr> <td style="border:1px solid pink" colspan="6"><strong>Co Investigators</strong></td> </tr> '; while ($corow = $costmt->FetchObject()) { $coid = $corow->account_id; $cotitle = $corow->title; $cosurname = $corow->surname; $coothernames = $corow->other_names; $coemail = $corow->email_address; $cousername = $corow->username; $coaccounttype = $corow->account_type; $cocount++; echo ' <tr> <td style="border:1px solid pink">' . $cocount . '<br></td> <td style="border:1px solid pink">' . $cotitle . '<br></td> <td style="border:1px solid pink">' . $coothernames . ' ' . $cosurname . '<br></td> <td style="border:1px solid pink">' . $coemail . '<br></td> <td style="border:1px solid pink">' . $cousername . '<br></td> <td style="border:1px solid pink">' . $coaccounttype . ' <br></td> </tr> '; } echo ' </table> </td> </tr> '; } echo ' <tr> <td><br></td> <tr> '; } echo ' </table> '; }
function pageList($p, $z) { $people = DbObject::_find('Person'); $this->assign('people', $people); }
public function pageDefault($p, $z) { $entries = DbObject::_find('Entry'); $this->assign('entries', $entries); // echo_r($entries); }
/** * This method kind of does... everything. It's the backbone of every read operation * and is a bit difficult to understand/explain * @param query - (optional) a query to load from (otherwise loadQuery is called) * @access private * @see fetch */ public function loadMultiple($query = '') { $ret = array(); $all_objects = array(); if (!$query instanceof Query) { $query = $this->loadQuery(); } $path = $this->queryCache($query); if (!$query->done()) { $query->doQuery(); } $all_objects = array(); $keys = array(); $rel_map = array(); $to_load = $this->flatten($keys, $rel_map); $my_keys = $keys[$this->getClass()]; $index = 0; $exc = array(); $class_counts = array(); foreach ($this->exclude as $exc_obj) { DbObject::addKeys($exc_obj, $keys); } if (!($ret = $this->cached($path))) { while ($row = $query->next()) { foreach ($to_load as $load) { $load_class = $load->getClass(); //true); $load_fetch_class = $load->getFetchClass(); //true); if (!isset($class_counts[$load_class])) { $class_counts[$load_class] = 0; } $class_counts[$load_class]++; if ($key = DbObject::completeKeyFromKeysAndArray($keys[$load_class], $row)) { $ref = $load_class . $key; if (!isset($all_objects[$ref])) { $all_objects[$ref] = $load->constructFromCompleteKey($key); $all_objects[$ref]->requires_insert = false; $all_objects[$ref]->table->setQuery($query, $index); } if (isset($rel_map[$load_class])) { if ($rel_map[$load_class]->rels[$load_fetch_class] == DbObject::JOIN_REL) { $rel_class = $rel_map[$load_class]->joins[$load_fetch_class]; $rel_obj = new $rel_class(); if ($key = DbObject::completeKeyFromKeysAndArray($keys[$rel_class], $row)) { $to_add = $rel_obj->constructFromCompleteKey($key); $to_add->table->setQuery($query, $index); $to_add->requires_insert = false; $all_objects[$ref]->add($to_add); } } else { if ($rel_map[$load_class]->rels[$load_fetch_class] == DbObject::FOREIGN_REL) { $parent_ref = $rel_map[$load_class]->getClass() . $rel_map[$load_class]->completeKeyFromArray($row); $all_objects[$parent_ref]->add($all_objects[$ref]); } } } } } $index = $query->currentIndex(); } $exc = array(); $this_class = $this->getClass(true); foreach ($all_objects as $obj) { if ($obj instanceof $this_class) { $obj->load_foreign = $this->load_foreign; } $class = $obj->getClass(); if (isset($rel_map[$class])) { $parent_class = $rel_map[$class]->getClass(); $parent_keys = DbObject::parentKeys($obj, $rel_map, $keys); if ($rel_map[$class]->rels[$class] == DbObject::DEPEND_REL) { $complete = implode('-', $parent_keys); foreach ($all_objects as $depend_add_key => $depend_add_obj) { if (strpos($depend_add_key, $parent_class . $complete) !== FALSE) { //$all_objects[$depend_add_key]->add($obj); try { if (isset($all_objects[$depend_add_key]->existing_objects[$obj->getClass()]) && count($all_objects[$depend_add_key]->existing_objects[$obj->getClass()]) <= $obj->getLimit() || !isset($all_objects[$depend_add_key]->existing_objects[$obj->getClass()])) { $all_objects[$depend_add_key]->add($obj); } } catch (Exception $e) { $all_objects[$depend_add_key]->add($obj); } } } } else { if ($parent_keys) { foreach ($parent_keys as $parent_key) { if (isset($all_objects[$parent_class . $parent_key]) && !in_array($class, $this->exclude_classes)) { try { if (isset($all_objects[$parent_class . $parent_key]->existing_objects[$obj->getClass()]) && count($all_objects[$parent_class . $parent_key]->existing_objects[$obj->getClass()]) <= $obj->getLimit() || !isset($all_objects[$parent_class . $parent_key]->existing_objects[$obj->getClass()])) { $all_objects[$parent_class . $parent_key]->add($obj); } } catch (Exception $e) { $all_objects[$parent_class . $parent_key]->add($obj); } } else { if (in_array($class, $this->exclude_classes)) { unset($ret[$parent_key]); $exc[] = $parent_key; } } } } } } else { if (!in_array($obj->completeKey(), $exc)) { $ret[$obj->completeKey()] = $obj; } } } $this->cache($path, $ret); } else { $stack = array(); $cur = $ret; while ($cur) { foreach ($cur as $obj) { if (count($obj->existing_objects) && is_array($obj->existing_objects)) { $arr = array(); foreach ($obj->existing_objects as $objs) { $arr = array_merge($arr, $objs); } array_push($stack, $arr); } $obj->table->setQuery($query); } $cur = array_pop($stack); } } $this->reset(); return $ret; }