/** * Gets an array of Courses 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 Category has previously been saved, it will retrieve * related Coursess from storage. If this Category 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 Courses[] * @throws PropelException */ public function getCoursess($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(CategoryPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collCoursess === null) { if ($this->isNew()) { $this->collCoursess = array(); } else { $criteria->add(CoursesPeer::CATEGORY_ID, $this->id); CoursesPeer::addSelectColumns($criteria); $this->collCoursess = CoursesPeer::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(CoursesPeer::CATEGORY_ID, $this->id); CoursesPeer::addSelectColumns($criteria); if (!isset($this->lastCoursesCriteria) || !$this->lastCoursesCriteria->equals($criteria)) { $this->collCoursess = CoursesPeer::doSelect($criteria, $con); } } } $this->lastCoursesCriteria = $criteria; return $this->collCoursess; }
<div id="tutorlist_ajax"> <div class="body" > <div id="cn-body"> <div class="body-connect-left"> <div class="cn-left-bg" style="margin-top: 25px;"> <div class="cn-left-top"></div> <h3 style="margin-bottom:8px;">Subject:</h3> <label> <form name="form1" id="form1" method="post"> <select name="course" onchange="alert('TODO')"> <option value="">--- SELECT ---</option> <?php /* @var $courses Courses[] */ $courses = CoursesPeer::doSelect(new Criteria()); foreach ($courses as $course) { echo '<option value="' . $course->getId() . '" >' . $course->getCourseName() . ' </option>'; } ?> </select> </form> </label> <div class="cn-spacer"></div> <h3>Filtering Options:</h3> <h4>Expert Status: <img src="../images/greyarrow-down.jpg" width="10" height="11" alt="" /></h4> <p><a href="" onClick="alert('TODO')">Online</a></p> <p><a href="" onClick="alert('TODO')">Offline</a></p> <h4>School: <img src="../images/greyarrow-down.jpg" width="10" height="11" alt="" /></h4> <select name="school" onchange="alert('TODO')" style="background:none;padding:4px;height:auto;border:1px solid #CCC"> <option value="">---- SELECT ----</option>
/** * 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(CoursesPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(CoursesPeer::DATABASE_NAME); $criteria->add(CoursesPeer::ID, $pks, Criteria::IN); $objs = CoursesPeer::doSelect($criteria, $con); } return $objs; }