/**
  * 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(CcShowDaysPeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(CcShowDaysPeer::DATABASE_NAME);
         $criteria->add(CcShowDaysPeer::ID, $pks, Criteria::IN);
         $objs = CcShowDaysPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
示例#2
0
 private function getShowDaysInRange($start, $end)
 {
     $endTimeString = $end->format("Y-m-d H:i:s");
     if (!is_null($start)) {
         $startTimeString = $start->format("Y-m-d H:i:s");
     } else {
         $today_timestamp = new DateTime("now", new DateTimeZone("UTC"));
         $startTimeString = $today_timestamp->format("Y-m-d H:i:s");
     }
     $c = new Criteria();
     $c->add(CcShowDaysPeer::FIRST_SHOW, $endTimeString, Criteria::LESS_THAN);
     $c->addAnd(CcShowDaysPeer::LAST_SHOW, $startTimeString, Criteria::GREATER_THAN);
     $c->addAnd(CcShowDaysPeer::REPEAT_TYPE, -1, Criteria::NOT_EQUAL);
     $c->addOr(CcShowDaysPeer::LAST_SHOW, null, Criteria::ISNULL);
     return CcShowDaysPeer::doSelect($c);
 }