public static function doSelectJoinkuser(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = self::prepareEntitlementCriteriaAndFilters($criteria); $results = parent::doSelectJoinkuser($c, $con, $join_behavior); self::$filerResults = false; return $results; }
public static function createTeam2Image($kshow_id) { try { $kshow = kshowPeer::retrieveByPK($kshow_id); if (!$kshow) { return NULL; } $contentPath = myContentStorage::getFSContentRootPath(); // TODO - maybe start from some kaltura background - so if image is not full - still interesting $im = imagecreatetruecolor(24 * 7 - 1, 24 * 2 - 1); $logo_path = kFile::fixPath(SF_ROOT_DIR . '/web/images/browse/contributorsBG.gif'); $im = imagecreatefromgif($logo_path); // fetch as many different kusers as possible who contributed to the kshow // first entries will come up first $c = new Criteria(); $c->add(entryPeer::KSHOW_ID, $kshow_id); $c->add(entryPeer::TYPE, entryType::MEDIA_CLIP, Criteria::EQUAL); //$c->add ( entryPeer::PICTURE, null, Criteria::NOT_EQUAL ); $c->setLimit(14); // we'll need 14 images of contributers $c->addGroupByColumn(entryPeer::KUSER_ID); $c->addDescendingOrderByColumn(entryPeer::CREATED_AT); $entries = BaseentryPeer::doSelectJoinkuser($c); if ($entries == NULL || count($entries) == 0) { imagedestroy($im); return; } $entry_list_len = count($entries); reset($entries); if ($entry_list_len > 0) { for ($y = 0; $y <= 1; ++$y) { for ($x = 0; $x <= 6; ++$x) { self::addKuserPictureFromEntry($contentPath, $im, $entries, $x, $y, 1, 24, 24); } } } else { // no contributers - need to create some other image } $path = kFile::fixPath($contentPath . $kshow->getTeam2PicturePath()); kFile::fullMkdir($path); imagepng($im, $path); imagedestroy($im); $kshow->setHasTeamImage(true); $kshow->save(); } catch (Exception $ex) { // nothing much we can do here ! } }
public static function doSelectJoinkuser(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = clone $criteria; if ($c instanceof KalturaCriteria) { $c->applyFilters(); $criteria->setRecordsCount($c->getRecordsCount()); } return parent::doSelectJoinkuser($c, $con, $join_behavior); }
public static function doSelectJoinkuser(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $c = clone $criteria; if ($c instanceof KalturaCriteria) { $skipApplyFilters = entryPeer::applyEntitlementCriteria($c); if (!$skipApplyFilters) { $c->applyFilters(); $criteria->setRecordsCount($c->getRecordsCount()); } } $results = parent::doSelectJoinkuser($c, $con, $join_behavior); self::$filerResults = false; return $results; }