/** * Gets an array of WhiteboardTutorFeedback objects which contain a foreign key that references this object. * * If this collection has already been initialized with an identical Criteria, it returns the collection. * Otherwise if this WhiteboardChat has previously been saved, it will retrieve * related WhiteboardTutorFeedbacks from storage. If this WhiteboardChat is new, it will return * an empty collection or the current collection, the criteria is ignored on a new object. * * @param PropelPDO $con * @param Criteria $criteria * @return array WhiteboardTutorFeedback[] * @throws PropelException */ public function getWhiteboardTutorFeedbacks($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(WhiteboardChatPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collWhiteboardTutorFeedbacks === null) { if ($this->isNew()) { $this->collWhiteboardTutorFeedbacks = array(); } else { $criteria->add(WhiteboardTutorFeedbackPeer::WHITEBOARD_CHAT_ID, $this->id); WhiteboardTutorFeedbackPeer::addSelectColumns($criteria); $this->collWhiteboardTutorFeedbacks = WhiteboardTutorFeedbackPeer::doSelect($criteria, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return the collection. $criteria->add(WhiteboardTutorFeedbackPeer::WHITEBOARD_CHAT_ID, $this->id); WhiteboardTutorFeedbackPeer::addSelectColumns($criteria); if (!isset($this->lastWhiteboardTutorFeedbackCriteria) || !$this->lastWhiteboardTutorFeedbackCriteria->equals($criteria)) { $this->collWhiteboardTutorFeedbacks = WhiteboardTutorFeedbackPeer::doSelect($criteria, $con); } } } $this->lastWhiteboardTutorFeedbackCriteria = $criteria; return $this->collWhiteboardTutorFeedbacks; }
<?php $adjacents = 1; $total_pages = WhiteboardTutorFeedbackPeer::doCount(new Criteria()); $targetpage = "/admin.php/whiteboardsession/tutor"; $limit = 50; $page = @$_GET['page']; if ($page) { $start = ($page - 1) * $limit; } else { $start = 0; } $criteria = new Criteria(); $criteria->setOffset($start); $criteria->setLimit($limit); $criteria->addDescendingOrderByColumn(WhiteboardTutorFeedbackPeer::CREATED_AT); $wtfS = WhiteboardTutorFeedbackPeer::doSelect($criteria); if ($page == 0) { $page = 1; } $prev = $page - 1; $next = $page + 1; $lastpage = ceil($total_pages / $limit); $lpm1 = $lastpage - 1; $pagination = ""; $pagination = ""; if ($lastpage > 1) { $pagination .= "<div class=\"pagination\">"; //previous button if ($page > 1) { $pagination .= "<a href=\"{$targetpage}?page={$prev}\">« previous</a>"; } else {
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(WhiteboardTutorFeedbackPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(WhiteboardTutorFeedbackPeer::DATABASE_NAME); $criteria->add(WhiteboardTutorFeedbackPeer::ID, $pks, Criteria::IN); $objs = WhiteboardTutorFeedbackPeer::doSelect($criteria, $con); } return $objs; }