本文整理汇总了PHP中PersonPeer::doCount方法的典型用法代码示例。如果您正苦于以下问题:PHP PersonPeer::doCount方法的具体用法?PHP PersonPeer::doCount怎么用?PHP PersonPeer::doCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PersonPeer
的用法示例。
在下文中一共展示了PersonPeer::doCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeIndex
public function executeIndex(sfWebRequest $request)
{
$text = $request->getParameter('search_by');
$this->results = array();
$this->messages = array();
$this->uris = array();
//person search
if ($this->getUser()->hasRights('person_index')) {
$c = new Criteria();
$c1 = $c->getNewCriterion(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$c2 = $c->getNewCriterion(PersonPeer::LAST_NAME, $text . '%', Criteria::LIKE);
//$c->setDistinct(PersonPeer::FIRST_NAME);
//$c->setDistinct(PersonPeer::LAST_NAME);
$c->add($c1->addOr($c2));
$this->results['person'] = PersonPeer::doCount($c);
$this->messages['person'] = ' person results';
$this->uris['person'] = 'person/index?filter=1&findperson=1&firstname=' . $text;
}
//passenger search
if ($this->getUser()->hasRights('passenger_index')) {
$c = new Criteria();
$c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
$c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$this->results['passenger'] = PassengerPeer::doCount($c);
$this->messages['passenger'] = ' passenger results';
$this->uris['passenger'] = 'passenger/index?filter=1&firstname=' . $text;
}
//companion search
if ($this->getUser()->hasRights('companion_index')) {
$c = new Criteria();
$c->add(CompanionPeer::NAME, $text . '%', Criteria::LIKE);
$this->results['companion'] = CompanionPeer::doCount($c);
$this->messages['companion'] = ' companion results';
$this->uris['companion'] = 'companion/index?filter=1&name=' . $text;
}
//mission search
if ($this->getUser()->hasRights('mission_index')) {
$c = new Criteria();
if (is_numeric($text)) {
$c->add(MissionPeer::ID, $text . '%', Criteria::LIKE);
$this->results['mission'] = MissionPeer::doCount($c);
$this->uris['mission'] = 'mission/index?filter=1&miss_id=' . $text;
} else {
$c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
$c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
$c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$this->results['mission'] = MissionPeer::doCount($c);
$this->uris['mission'] = 'mission/index?filter=1&pass_fname=' . $text;
}
$this->messages['mission'] = ' mission results';
}
//leg search
if ($this->getUser()->hasRights('leg_index')) {
$c = new Criteria();
$c->addJoin(MissionLegPeer::MISSION_ID, MissionPeer::ID, Criteria::LEFT_JOIN);
$c->addJoin(MissionPeer::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
$c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
$c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$this->results['leg'] = MissionLegPeer::doCount($c);
$this->messages['leg'] = ' mission leg results';
$this->uris['leg'] = 'missionLeg/index?filter=1&pass_fname=' . $text;
}
//requester search
if ($this->getUser()->hasRights('requester_index')) {
$c = new Criteria();
$c->addJoin(RequesterPeer::PERSON_ID, PersonPeer::ID, Criteria::LEFT_JOIN);
$c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$this->results['requester'] = RequesterPeer::doCount($c);
$this->messages['requester'] = ' requester results';
$this->uris['requester'] = 'requester/index?filter=1&firstname=' . $text;
}
//agency search
if ($this->getUser()->hasRights('agency_index')) {
$c = new Criteria();
$c->add(AgencyPeer::NAME, $text . '%', Criteria::LIKE);
$this->results['agency'] = AgencyPeer::doCount($c);
$this->messages['agency'] = ' agency results';
$this->uris['agency'] = 'agency/index?filter=1&name=' . $text;
}
//coordinator search
if ($this->getUser()->hasRights('coordinator_index')) {
$c = new Criteria();
$c->addJoin(CoordinatorPeer::MEMBER_ID, MemberPeer::ID);
$c->addJoin(PersonPeer::ID, MemberPeer::PERSON_ID);
$c->add(PersonPeer::FIRST_NAME, $text . '%', Criteria::LIKE);
$this->results['coordinator'] = CoordinatorPeer::doCount($c);
$this->messages['coordinator'] = ' coordinator results';
$this->uris['coordinator'] = 'coordinator/index?filter=1&firstname=' . $text;
}
//camp search
if ($this->getUser()->hasRights('camp_index')) {
$c = new Criteria();
$c->add(CampPeer::CAMP_NAME, $text . '%', Criteria::LIKE);
$this->results['camp'] = CampPeer::doCount($c);
$this->messages['camp'] = ' camp results';
$this->uris['camp'] = 'camp/index?filter=1&camp_name=' . $text;
}
//airport search
if ($this->getUser()->hasRights('airport_index')) {
$c = new Criteria();
//.........这里部分代码省略.........