本文整理汇总了PHP中sfPropelPager类的典型用法代码示例。如果您正苦于以下问题:PHP sfPropelPager类的具体用法?PHP sfPropelPager怎么用?PHP sfPropelPager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了sfPropelPager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeIndex
/**
* Executes index action
*
* @param sfWebRequest $request
*/
public function executeIndex(sfWebRequest $request)
{
$this->filter = new PropertyFormFilter();
//$this->property_list = PropertyPeer::doSelect(new Criteria());
$this->sort = $this->getRequestParameter('sort');
$this->sort_type = $this->getRequestParameter('sort_type');
$criteria = new Criteria();
if (!is_null($this->sort)) {
if (!is_null($this->sort_type) && $this->sort_type == 'desc') {
$criteria->addDescendingOrderByColumn(PropertyPeer::$this->sort);
} elseif (!is_null($this->sort_type) && $this->sort_type == 'asc') {
$criteria->addAscendingOrderByColumn(PropertyPeer::$this->sort);
}
}
if ($request->hasParameter('property_filters')) {
$property_filters = $request->getParameter('property_filters');
$this->filter->bind($property_filters);
if ($this->filter->isValid()) {
!empty($property_filters['municipality']['text']) ? $criteria->add(PropertyPeer::MUNICIPALITY, "%" . $property_filters['municipality']['text'] . "%", Criteria::LIKE) : null;
!empty($property_filters['offer_id']) ? $criteria->add(PropertyPeer::OFFER_ID, $property_filters['offer_id']) : null;
!empty($property_filters['type_id']) ? $criteria->add(PropertyPeer::TYPE_ID, $property_filters['type_id']) : null;
!empty($property_filters['typology_id']) ? $criteria->add(PropertyPeer::TYPOLOGY_ID, $property_filters['typology_id']) : null;
!empty($property_filters['state_id']) ? $criteria->add(PropertyPeer::STATE_ID, $property_filters['state_id']) : null;
!empty($property_filters['price']['text']) ? $criteria->add(PropertyPeer::PRICE, $property_filters['price']['text'], Criteria::LESS_EQUAL) : null;
}
}
$pager = new sfPropelPager('Property', sfConfig::get('app_max_propertyes_list', 20));
$pager->setPeerMethod('doSelectJoinAll');
$pager->setCriteria($criteria);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
}
示例2: executeList
public function executeList(Criteria $crit = null)
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
if ($crit == null) {
$crit = new Criteria();
}
$this->sort($crit);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($crit, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), ' payment_journal_s'));
$this->getUser()->setAttribute('max_per_page', $rpp, ' payment_journal_s');
$pager = new sfPropelPager('PaymentJournal', $rpp);
$pager->setCriteria($crit);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, ' payment_journal_s'));
$this->getUser()->setAttribute('page', $page, ' payment_journal_s');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => ' payment_journal_s/create', 'color' => 'green'));
}
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => ' payment_journal_s/listAsCSV', 'color' => 'white', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => ' payment_journal_s/listAsPDF', 'color' => 'white', 'type' => 'direct'));
$this->actions = $actions;
$this->subtitle = '';
$this->byStudent = true;
}
示例3: getPager
public static function getPager($max = 10, $page = 1, $fbo_name = null, $discount = null, $default = null, $ident = null, $name = null, $city = null, $state = null)
{
$c = new Criteria();
$c->addJoin(self::AIRPORT_ID, AirportPeer::ID);
if ($fbo_name) {
$c->add(self::NAME, '%' . $fbo_name . '%', Criteria::LIKE);
}
if ($discount) {
$c->add(self::FUEL_DISCOUNT, '%' . $discount . '%', Criteria::LIKE);
}
if ($default) {
$c->add(self::FUEL_DISCOUNT, '%' . $discount . '%', Criteria::LIKE);
}
if ($ident) {
$c->add(AirportPeer::IDENT, $ident . '%', Criteria::LIKE);
}
if ($name) {
$c->add(AirportPeer::NAME, $name . '%', Criteria::LIKE);
}
if ($city) {
$c->add(AirportPeer::CITY, $city . '%', Criteria::LIKE);
}
if ($state) {
$c->add(AirportPeer::STATE, $state . '%', Criteria::LIKE);
}
$c->addAscendingOrderByColumn(self::NAME);
$pager = new sfPropelPager('Fbo', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例4: doSearch
static function doSearch($TEXT, $idS = 1, $page = 1)
{
$C = new Criteria();
$C = AgendatelefonicaPeer::getCriteriaActiu($C, $idS);
$PARAULES = explode(" ", $TEXT);
$PAR2 = array();
foreach ($PARAULES as $P) {
if (strlen($P) > 2) {
$PAR2[] = trim($P);
}
}
foreach ($PAR2 as $P) {
$text1Criterion = $C->getNewCriterion(AgendatelefonicaPeer::NOM, '%' . $P . '%', CRITERIA::LIKE);
$text2Criterion = $C->getNewCriterion(AgendatelefonicaPeer::TAGS, '%' . $P . '%', CRITERIA::LIKE);
$text3Criterion = $C->getNewCriterion(AgendatelefonicaPeer::ENTITAT, '%' . $P . '%', CRITERIA::LIKE);
$text1Criterion->addOr($text2Criterion);
$text1Criterion->addOr($text3Criterion);
$C->add($text1Criterion);
}
$C->add(AgendatelefonicaPeer::SITE_ID, $idS);
$C->addGroupByColumn(AgendatelefonicaPeer::AGENDATELEFONICAID);
$C->addAscendingOrderByColumn(AgendatelefonicaPeer::NOM);
$pager = new sfPropelPager('Agendatelefonica', 20);
$pager->setCriteria($C);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例5: executeList
/**
* Displays either the inbox or outbox
*/
public function executeList()
{
if ($this->getRequestParameter('folder') == 'outbox') {
//Grab all sent messages
$c = PrivateMessagePeer::getCriteriaForSentToUser($this->getUser()->getRaykuUserId());
//Name of the partial to use for each message
$this->messageRowPartialName = 'message_row_outbox';
//Name the URL for the pager
$url = '@outbox';
} else {
//Grab all recieved messages
$c = PrivateMessagePeer::getCriteriaForRecievedByUser($this->getUser()->getRaykuUserId());
//Name of the partial to use for each message
$this->messageRowPartialName = 'message_row_inbox';
//Name the URL for the pager
$url = '@inbox';
}
//Setup the pager
$pager = new sfPropelPager('PrivateMessage', sfConfig::get('app_messages_messages_per_page', 10));
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->raykuPager = new RaykuPagerRenderer($pager);
$this->raykuPager->setBaseUrl($url);
}
示例6: getPager
public static function getPager($max = 10, $page = 1, Criteria $c)
{
/*$c = new Criteria();
$c->addJoin(self::LETTER_ID, EmailLetterPeer::alias('letter', EmailLetterPeer::ID), Criteria::LEFT_JOIN);
//person
$c->addAlias('letter', EmailLetterPeer::TABLE_NAME);
if ($subject)
$c->add(EmailLetterPeer::SUBJECT, $subject . '%', Criteria::LIKE);
if ($priority)
$c->add(self::PRIORITY, $priority . '%', Criteria::LIKE);
if ($request_date) {
$c->add(self::REQUEST_DATE, date('Y-m-d H:i', strtotime($request_date)) . ':00', Criteria::EQUAL);
} elseif ($send_date) {
$c->add(self::SEND_DATE, date('Y-m-d H:i', strtotime($send_date)) . ':00', Criteria::EQUAL);
}*/
//self::addSelectColumns($c);
//$c->addAscendingOrderByColumn('request_date');
$pager = new sfPropelPager('EmailQueue', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例7: getPager
public static function getPager($max = 10, $page = 1, $firstname = null, $lastname = null, $city = null, $state = null, $country = null, $coor_of_week = null)
{
$c = new Criteria();
$c->addJoin(self::MEMBER_ID, MemberPeer::ID);
$c->addJoin(PersonPeer::ID, MemberPeer::PERSON_ID);
if ($firstname) {
$c->add(PersonPeer::FIRST_NAME, $firstname . '%', Criteria::LIKE);
}
if ($lastname) {
$c->add(PersonPeer::LAST_NAME, $lastname . '%', Criteria::LIKE);
}
if ($city) {
$c->add(PersonPeer::CITY, $city . '%', Criteria::LIKE);
}
if ($state) {
$c->add(PersonPeer::STATE, $state . '%', Criteria::LIKE);
}
if ($country) {
$c->add(PersonPeer::COUNTRY, $country . '%', Criteria::LIKE);
}
if ($coor_of_week) {
$c->add(self::COOR_OF_THE_WEEK, $coor_of_week . '%', Criteria::LIKE);
}
$c->addAscendingOrderByColumn(PersonPeer::FIRST_NAME);
$pager = new sfPropelPager('Coordinator', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例8: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$ct = new Criteria();
$ct->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($ct);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$c->add(GradeSpecPeer::TYPE_SPEC, GradeSpec::OTHERS, Criteria::NOT_EQUAL);
$c->add(GradeSpecPeer::PARENT, 0, Criteria::IN);
$this->sort($c);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'grade_spec'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'grade_spec');
$pager = new sfPropelPager('GradeSpec', $rpp);
#$pager->setPeerMethod('doSelectOrdered');
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'grade_spec'));
$this->getUser()->setAttribute('page', $page, 'grade_spec');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'grade_spec_new/create', 'color' => 'black'));
}
$this->actions = $actions;
$this->subtitle = '';
}
示例9: doSearch
static function doSearch($TEXT, $PAGE, $ACCIO, $idS)
{
$C = new Criteria();
$C = self::getCriteriaActiu($C, $idS);
$PARAULES = explode(" ", $TEXT);
$PAR2 = array();
foreach ($PARAULES as $P) {
if (strlen($P) > 2) {
$PAR2[] = trim($P);
}
}
foreach ($PAR2 as $P) {
$text1Criterion = $C->getNewCriterion(MissatgesPeer::TITOL, '%' . $P . '%', CRITERIA::LIKE);
$text2Criterion = $C->getNewCriterion(MissatgesPeer::TEXT, '%' . $P . '%', CRITERIA::LIKE);
$text1Criterion->addOr($text2Criterion);
$C->add($text1Criterion);
}
$C->addGroupByColumn(MissatgesPeer::MISSATGEID);
$C->addDescendingOrderByColumn(self::PUBLICACIO);
$C->addDescendingOrderByColumn(self::MISSATGEID);
if ($ACCIO != 'SF') {
$C->add(MissatgesPeer::PUBLICACIO, date('Y-m-d', time()), CRITERIA::LESS_EQUAL);
} else {
$C->add(MissatgesPeer::PUBLICACIO, date('Y-m-d', time()), CRITERIA::GREATER_THAN);
}
$pager = new sfPropelPager('Missatges', 20);
$pager->setCriteria($C);
$pager->setPage($PAGE);
$pager->init();
return $pager;
}
示例10: getPager
public static function getPager($max = 10, $page = 1, $firstname = null, $lastname = null, $city = null, $state = null, $agency_name = null)
{
$c = new Criteria();
$c->addJoin(PersonPeer::ID, self::PERSON_ID);
$c->addJoin(self::AGENCY_ID, AgencyPeer::ID);
if ($firstname) {
$c->add(PersonPeer::FIRST_NAME, $firstname . '%', Criteria::LIKE);
}
if ($lastname) {
$c->add(PersonPeer::LAST_NAME, $lastname . '%', Criteria::LIKE);
}
if ($city) {
$c->add(PersonPeer::CITY, $city . '%', Criteria::LIKE);
}
if ($state) {
$c->add(PersonPeer::STATE, $state . '%', Criteria::LIKE);
}
if ($agency_name) {
$c->add(AgencyPeer::NAME, $agency_name . '%', Criteria::LIKE);
}
$c->addAscendingOrderByColumn(PersonPeer::FIRST_NAME);
$pager = new sfPropelPager('Requester', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例11: executeIndex
public function executeIndex(sfWebRequest $request)
{
//get request parameters
$this->selectedBrand = $this->getRequestParameter('brand');
$this->selectedSeries = $this->getRequestParameter('series');
$this->selectedModel = $this->getRequestParameter('model');
$cConfig = new Criteria();
$cConfig->addJoin(ConfigPeer::MODEL_ID, ModelPeer::ID);
$cConfig->addJoin(ModelPeer::SERIES_ID, SeriesPeer::ID);
$cConfig->addJoin(SeriesPeer::BRAND_ID, BrandPeer::ID);
if ($this->selectedBrand) {
$cConfig->add(BrandPeer::ID, $this->selectedBrand);
}
if ($this->selectedSeries) {
$cConfig->add(SeriesPeer::SERIES_NAME, $this->selectedSeries, Criteria::LIKE);
}
if ($this->selectedModel) {
$cConfig->add(ModelPeer::MODEL_NAME, $this->selectedModel, Criteria::LIKE);
}
//$this->Configs = ConfigPeer::doSelect($cConfig);
//paginatiom
$pager = new sfPropelPager('Config', 15);
$pager->setCriteria($cConfig);
$pager->setPage($this->getRequestParameter('page'));
$pager->init();
$this->pager = $pager;
//get config columns
$c = new Criteria();
$c->addDescendingOrderByColumn(ConfigFieldCategoryPeer::WEIGHT);
$this->configFieldCategories = ConfigFieldCategoryPeer::doSelect($c);
//get brands
$cBrand = new Criteria();
$this->brands = BrandPeer::doSelect($cBrand);
}
示例12: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$c = new Criteria();
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'academic_cost_component'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'academic_cost_component');
$pager = new sfPropelPager('AcademicCostComponent', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'academic_cost_component'));
$this->getUser()->setAttribute('page', $page, 'academic_cost_component');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'academic_cost_component/create', 'color' => 'black'));
}
$this->actions = $actions;
$cw = new Criteria();
$cw->add(JobPeer::PARENT, $job->getId());
$modules = JobPeer::doSelect($cw);
$this->modules = $modules;
$actions2 = array(array('name' => '<span>Komponen Biaya Sekolah</span>', 'url' => $job->getCode(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例13: executeList
public function executeList()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
$this->forward404Unless($student);
$this->student = $student;
$c = new Criteria();
$c->add(StudentLeavePeer::STUDENT_ID, $student->getId());
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student_leave_by_student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student_leave_by_student');
$pager = new sfPropelPager('StudentLeave', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_leave_by_student'));
$this->getUser()->setAttribute('page', $page, 'student_leave_by_student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
if ($acl->getAddPriv()) {
array_unshift($actions, array('name' => 'add', 'url' => 'student_leave_by_student/create?student_id=' . $student->getId(), 'color' => 'green'));
}
array_unshift($actions, array('type' => 'direct', 'name' => 'paymentSlip', 'url' => 'student_leave_by_student/paymentSlip?student_id=' . $student->getId(), 'color' => 'white'));
$this->actions = $actions;
$this->subtitle = $student->toString();
}
示例14: getPager
public static function getPager($max = 10, $page = 1, $camp_name = null, $agency_name = null, $agency_city = null, $agency_state = null, $agency_country = null, $airport_ident = null, $airport_city = null, $airport_state = null)
{
$c = new Criteria();
$c->addJoin(self::AGENCY_ID, AgencyPeer::ID, Criteria::LEFT_JOIN);
$c->addJoin(self::AIRPORT_ID, AirportPeer::ID, Criteria::LEFT_JOIN);
if ($camp_name) {
$c->add(self::CAMP_NAME, $camp_name . '%', Criteria::LIKE);
}
if ($agency_name) {
$c->add(AgencyPeer::NAME, $agency_name . '%', Criteria::LIKE);
}
if ($agency_city) {
$c->add(AgencyPeer::CITY, $agency_city . '%', Criteria::LIKE);
}
if ($agency_state) {
$c->add(AgencyPeer::STATE, $agency_state . '%', Criteria::LIKE);
}
if ($airport_ident) {
$c->add(AirportPeer::IDENT, $airport_ident . '%', Criteria::LIKE);
}
if ($airport_city) {
$c->add(AirportPeer::CITY, $airport_city . '%', Criteria::LIKE);
}
if ($airport_state) {
$c->add(AirportPeer::STATE, $airport_state . '%', Criteria::LIKE);
}
$c->addAscendingOrderByColumn(self::CAMP_NAME);
$pager = new sfPropelPager('Camp', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}
示例15: getPager
public static function getPager($max = 10, $page = 1, $ident = null, $name = null, $city = null, $state = null, $wing_name = null, $closed = null)
{
$c = new Criteria();
$c->addJoin(self::WING_ID, WingPeer::ID, Criteria::LEFT_JOIN);
if ($ident) {
$c->add(self::IDENT, $ident . '%', Criteria::LIKE);
}
if ($name) {
$c->add(self::NAME, $name . '%', Criteria::LIKE);
}
if ($city) {
$c->add(self::CITY, $city . '%', Criteria::LIKE);
}
if ($state) {
$c->add(self::STATE, $state . '%', Criteria::LIKE);
}
if ($wing_name) {
$c->add(WingPeer::NAME, $wing_name . '%', Criteria::LIKE);
}
if ($closed) {
$c->add(self::CLOSED, $closed . '%', Criteria::LIKE);
}
self::addSelectColumns($c);
$c->addAsColumn("fbos", "(Select COUNT(a.id) from fbo as f, airport as a where f.airport_id = a.id and a.id = " . self::ID . " group by a.id)");
$c->addAscendingOrderByColumn(self::IDENT);
$pager = new sfPropelPager('Airport', $max);
$pager->setCriteria($c);
$pager->setPage($page);
$pager->init();
return $pager;
}