本文整理汇总了PHP中Criteria::setIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:PHP Criteria::setIgnoreCase方法的具体用法?PHP Criteria::setIgnoreCase怎么用?PHP Criteria::setIgnoreCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Criteria
的用法示例。
在下文中一共展示了Criteria::setIgnoreCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: search
public static function search($query_string, $sf_user, $limit = 12)
{
$query_string = trim($query_string);
if (!is_null($query_string) && !empty($query_string) && '' != $query_string && strlen($query_string) > 3) {
$criteria = new Criteria();
$criteria->setIgnoreCase(true);
$criteria->setLimit($limit);
$criteria->add(SchoolYearStudentPeer::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId());
$criteria->addJoin(SchoolYearStudentPeer::STUDENT_ID, self::ID);
$criteria->addJoin(self::PERSON_ID, PersonPeer::ID, Criteria::INNER_JOIN);
$criteria->addAscendingOrderByColumn(PersonPeer::LASTNAME);
if (is_numeric($query_string)) {
// Search by identification number
$criteria->add(PersonPeer::IDENTIFICATION_NUMBER, $query_string . '%', Criteria::LIKE);
} else {
// Search by firstname or lastname
$criterion = $criteria->getNewCriterion(PersonPeer::FIRSTNAME, $query_string . '%', Criteria::LIKE);
$criterion->addOr($criteria->getNewCriterion(PersonPeer::LASTNAME, $query_string . '%', Criteria::LIKE));
$criteria->add($criterion);
}
if ($sf_user->isPreceptor()) {
PersonalPeer::joinWithStudents($criteria, $sf_user->getGuardUser()->getId());
} elseif ($sf_user->isTeacher()) {
TeacherPeer::joinWithStudents($criteria, $sf_user->getGuardUser()->getId());
}
//FALTA HEAD PRECEPTOR
return self::doSelectActive($criteria);
}
return array();
}
示例2: retrieveByUuid
public static function retrieveByUuid($value)
{
$c = new Criteria();
$c->add(self::UUID, $value);
$c->setIgnoreCase(true);
return self::doSelectOne($c);
}
示例3: addWordColumnCriteria
public function addWordColumnCriteria(Criteria $criteria, $field, $value)
{
$value = "%{$value}%";
$criteria->setIgnoreCase(true);
$criterion = $criteria->getNewCriterion(SubjectPeer::NAME, $value, Criteria::LIKE);
$criterion->addOr($criteria->getNewCriterion(SubjectPeer::FANTASY_NAME, $value, Criteria::LIKE));
$criteria->add($criterion);
}
示例4: getNbFiles
public static function getNbFiles($entity, $entity_id)
{
$c = new Criteria();
$c->add(sfFileGalleryPeer::ENTITY, $entity);
$c->add(sfFileGalleryPeer::ENTITY_ID, $entity_id);
$c->setIgnoreCase(true);
return sfFileGalleryPeer::doCount($c);
}
示例5: getByName
public function getByName($name)
{
$c = new Criteria();
$c->add(NagiosTimeperiodPeer::NAME, $name);
$c->setIgnoreCase(true);
$timeperiod = NagiosTimeperiodPeer::doSelectOne($c);
if (!$timeperiod) {
return false;
}
return $timeperiod;
}
示例6: getByName
public function getByName($name)
{
$c = new Criteria();
$c->add(NagiosHostTemplatePeer::NAME, $name);
$c->setIgnoreCase(true);
$template = NagiosHostTemplatePeer::doSelectOne($c);
if (!$template) {
return false;
}
return $template;
}
示例7: getByName
public function getByName($name)
{
$c = new Criteria();
$c->add(NagiosContactPeer::NAME, $name);
$c->setIgnoreCase(true);
$contact = NagiosContactPeer::doSelectOne($c);
if (!$contact) {
return false;
}
return $contact;
}
示例8: getByName
public function getByName($name)
{
$c = new Criteria();
$c->add(NagiosHostgroupPeer::NAME, $name);
$c->setIgnoreCase(true);
$hostgroup = NagiosHostgroupPeer::doSelectOne($c);
if (!$hostgroup) {
return false;
}
return $hostgroup;
}
示例9: import
public function import()
{
$job = $this->getEngine()->getJob();
$config = $this->getEngine()->getConfig();
$command = new NagiosCommand();
$segment = $this->getSegment();
// First check if we have a use
$useTemplate = $segment->get("use");
if ($useTemplate) {
// Okay, we need to check to see if we have an existing dependency
$val = $useTemplate[0]['value'];
$c = new Criteria();
$c->add(NagiosCommandPeer::NAME, $val);
$c->setIgnoreCase(true);
$dependant = NagiosCommandPeer::doSelectOne($c);
if ($dependant) {
$command->setLine($dependant->getLine());
}
$dependant->clearAllReferences(true);
}
$values = $segment->getValues();
$fileName = $segment->getFilename();
$commandLine = array();
foreach ($values as $key => $entries) {
foreach ($entries as $entry) {
$value = $entry['value'];
$lineNum = $entry['line'];
if (key_exists($key, $this->fieldMethods) && $this->fieldMethods[$key] != '') {
if ($key == "command_line") {
// Combine into our line array
$commandLine[] = $value;
continue;
}
// Okay, let's check that the method DOES exist
if (!method_exists($command, $this->fieldMethods[$key])) {
$job->addError("Method " . $this->fieldMethods[$key] . " does not exist for variable: " . $key . " on line " . $lineNum . " in file " . $fileName);
if (!$config->getVar('continue_error')) {
return false;
}
} else {
call_user_method($this->fieldMethods[$key], $command, $value);
}
}
}
}
// re-assemble command
$commandLine = implode(',', $commandLine);
$command->setLine($commandLine);
$command->save();
$command->clearAllReferences(true);
$job->addNotice("NagiosCommandImporter finished importing command: " . $command->getName());
return true;
}
示例10: addUsernameColumnCriteria
public function addUsernameColumnCriteria(Criteria $criteria, $field, $value)
{
$value = trim($value);
if ($value != '') {
$value = "%{$value}%";
$criteria->setIgnoreCase(true);
$criteria->addJoin(TeacherPeer::PERSON_ID, PersonPeer::ID);
$criteria->addJoin(PersonPeer::USER_ID, sfGuardUserPeer::ID);
$criterion = $criteria->getNewCriterion(sfGuardUserPeer::USERNAME, $value, Criteria::LIKE);
$criteria->add($criterion);
}
}
示例11: retrievePager
public static function retrievePager($c = null, $page = 1, $max = 10)
{
if ($c == null) {
$c = new Criteria();
}
$c->addDescendingOrderByColumn(self::LAST_NAME);
$c->setIgnoreCase(true);
$pager = new sfPropelPager('sfGuardUserProfile', $max);
$pager->setCriteria($c);
$pager->setPeerMethod('doSelectJoinSfGuardUser');
$pager->setPage($page);
$pager->init();
return $pager;
}
示例12: getLightboxArray
public static function getLightboxArray($entity, $entity_id)
{
$images = array();
$c = new Criteria();
$c->add(sfPhotoGalleryPeer::ENTITY, $entity);
$c->add(sfPhotoGalleryPeer::ENTITY_ID, $entity_id);
$c->setIgnoreCase(true);
$photos = sfPhotoGalleryPeer::doSelect($c);
if (count($photos) > 0) {
foreach ($photos as $photo) {
$images[] = array('real_name' => $photo->getRealName(), 'options' => array('title' => $photo->getDescription()));
}
}
return $images;
}
示例13: retrieveByEmail
public static function retrieveByEmail($value)
{
$data = split('@', $value);
$email = $data[1];
$c = new Criteria();
$c->add(self::EMAIL, $email);
$c->setIgnoreCase(true);
$result = self::doSelectOne($c);
if ($result == null) {
sfContext::getInstance()->getLogger()->log('no matching email domain for (' . $email . ')');
return false;
}
sfContext::getInstance()->getLogger()->log('matching email domain found');
return $result;
}
示例14: getByHostTemplateAndDescription
public static function getByHostTemplateAndDescription($hostTemplateName, $description)
{
// First get host template
$template = NagiosHostTemplatePeer::getByName($hostTemplateName);
if (!$template) {
return false;
}
$c = new Criteria();
$c->add(NagiosServicePeer::HOST_TEMPLATE, $template->getId());
$c->add(NagiosServicePeer::DESCRIPTION, $description);
$c->setIgnoreCase(true);
$service = NagiosServicePeer::doSelectOne($c);
if (!$service) {
return false;
}
return $service;
}
示例15: retrievePager
public static function retrievePager($c = null, $page = 1, $max = null)
{
if ($c == null) {
$c = new Criteria();
}
if ($max == null) {
$max = sfConfig::get('app_pager_project_max');
}
$c->addDescendingOrderByColumn(ProjectPeer::CREATED_AT);
$c->setIgnoreCase(true);
$pager = new sfPropelPager('Project', $max);
$pager->setCriteria($c);
//$pager->setPeerMethod('doSelectJoinSfGuardUserRelatedByOwnerId');
$pager->setPage($page);
$pager->init();
return $pager;
}