本文整理汇总了PHP中QueryObject::addAndCondition方法的典型用法代码示例。如果您正苦于以下问题:PHP QueryObject::addAndCondition方法的具体用法?PHP QueryObject::addAndCondition怎么用?PHP QueryObject::addAndCondition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryObject
的用法示例。
在下文中一共展示了QueryObject::addAndCondition方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllByName
/**
* @param string $first_name
* @param string $last_name
* @return ICommunityMember[]
*/
public function getAllByName($first_name, $last_name)
{
$query = new QueryObject(new Member());
$query->addAndCondition(QueryCriteria::equal('FirstName', $first_name));
$query->addAndCondition(QueryCriteria::equal('Surname', $last_name));
return $this->getAll($query, 0, 999999);
}
示例2: getAllIClaMembersByLastName
/**
* @param string $last_name
* @param int $offset
* @param int $limit
* @return array
*/
function getAllIClaMembersByLastName($last_name, $offset, $limit)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('CLASigned', true));
$query->addAndCondition(QueryCriteria::like('Surname', $last_name));
return $this->getAll($query, $offset, $limit);
}
示例3: getByTemplateAndCreator
/**
* @param int $template_id
* @param int $creator_id
* @return ISurvey|null
*/
public function getByTemplateAndCreator($template_id, $creator_id)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('TemplateID', $template_id));
$query->addAndCondition(QueryCriteria::equal('CreatedByID', $creator_id));
return $this->getBy($query);
}
示例4: getAllNotPostedAndNotRejected
/**
* @param int $offset
* @param int $limit
* @return array
*/
public function getAllNotPostedAndNotRejected($offset = 0, $limit = 10)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('isPosted', 0));
$query->addAndCondition(QueryCriteria::equal('isRejected', 0));
return $this->getAll($query, $offset, $limit);
}
示例5: getNextAvailableByType
/**
* @param string $promo_code_type
* @param int $batch_size
* @return ISpeakerSummitRegistrationPromoCode
*/
public function getNextAvailableByType($promo_code_type, $batch_size = 10)
{
switch ($promo_code_type) {
case ISpeakerSummitRegistrationPromoCode::TypeAccepted:
if (count($this->promo_code_speaker_session_pool) === 0) {
$query = new QueryObject(new SpeakerSummitRegistrationPromoCode());
$query->addAndCondition(QueryCriteria::equal('Type', $promo_code_type));
$query->addAndCondition(QueryCriteria::equal('OwnerID', 0));
$query->addAndCondition(QueryCriteria::equal('SpeakerID', 0));
$query->addAndCondition(QueryCriteria::equal('SummitID', Summit::get_active()->ID));
$query->addOrder(QueryOrder::asc('ID'));
list($this->promo_code_speaker_session_pool, $count) = $this->getAll($query, 0, $batch_size);
}
return array_shift($this->promo_code_speaker_session_pool);
break;
case ISpeakerSummitRegistrationPromoCode::TypeAlternate:
if (count($this->promo_code_alternate_speaker_session_pool) === 0) {
$query = new QueryObject(new SpeakerSummitRegistrationPromoCode());
$query->addAndCondition(QueryCriteria::equal('Type', $promo_code_type));
$query->addAndCondition(QueryCriteria::equal('OwnerID', 0));
$query->addAndCondition(QueryCriteria::equal('SpeakerID', 0));
$query->addAndCondition(QueryCriteria::equal('SummitID', Summit::get_active()->ID));
$query->addOrder(QueryOrder::asc('ID'));
list($this->promo_code_alternate_speaker_session_pool, $count) = $this->getAll($query, 0, $batch_size);
}
return array_shift($this->promo_code_alternate_speaker_session_pool);
break;
}
return null;
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:35,代码来源:SapphireSpeakerSummitRegistrationPromoCodeRepository.php
示例6: makeDigest
/**
* @param int $batch_size
* @param string $email_alert_to
* @param string $details_url
*/
public function makeDigest($batch_size = 15, $email_alert_to, $details_url)
{
$email_repository = $this->email_repository;
$repository = $this->repository;
$factory = $this->factory;
$this->tx_manager->transaction(function () use($batch_size, $email_alert_to, $details_url, $repository, $email_repository, $factory) {
$last_email = $email_repository->getLastOne();
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('isPosted', 0));
$query->addAndCondition(QueryCriteria::equal('isRejected', 0));
if ($last_email) {
$query->addAndCondition(QueryCriteria::greater('ID', $last_email->getLastEventRegistrationRequest()->getIdentifier()));
}
$query->addOrder(QueryOrder::asc('PostDate'));
list($list, $size) = $repository->getAll($query, 0, $batch_size);
if ($list && count($list) > 0) {
$last_one = end($list);
reset($list);
$email = EmailFactory::getInstance()->buildEmail(EVENT_REGISTRATION_REQUEST_EMAIL_FROM, $email_alert_to, "New Event Registration Requests");
$email->setTemplate('EventAlertEmail');
$email->populateTemplate(array('RegistrationRequests' => new ArrayList($list), 'Details' => $details_url));
$email->send();
$email_repository->add($factory->buildEventAlertEmail($last_one));
}
});
}
示例7: getFeedback
public function getFeedback($event_id, $member_id)
{
$query = new QueryObject(new SummitEventFeedback());
$query->addAndCondition(QueryCriteria::equal('OwnerID', $member_id));
$query->addAndCondition(QueryCriteria::equal('EventID', $event_id));
return $this->getBy($query);
}
示例8: findByInviteEmailAndTeam
/**
* @param string $email
* @param ITeam $team
* @return ITeamInvitation
*/
public function findByInviteEmailAndTeam($email, ITeam $team)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('Email', $email));
$query->addAndCondition(QueryCriteria::equal('TeamID', $team->getIdentifier()));
return $this->getBy($query);
}
示例9: getByNameAndCompany
/**
* @param string $name
* @param int $company_id
* @return ITeam
*/
public function getByNameAndCompany($name, $company_id)
{
$query = new QueryObject(new Team());
$query->addAndCondition(QueryCriteria::equal('CompanyID', $company_id));
$query->addAndCondition(QueryCriteria::equal('Name', $name));
return $this->getBy($query);
}
示例10: search
public function search()
{
$output = '';
if (!$this->isJson()) {
return $this->httpError(500, 'Content Type not allowed');
}
try {
$search_params = json_decode($this->request->getBody(), true);
$query = new QueryObject(new Consultant());
$query->addAlias(QueryAlias::create('Company'));
$query->addAndCondition(QueryCriteria::equal("Active", true));
$location = @explode(',', @$search_params['location_term']);
$name = @$search_params['name_term'];
$service = @$search_params['service_term'];
$region = @$search_params['region_term'];
if (!empty($name)) {
$query->addAndCondition(QueryCompoundCriteria::compoundOr(array(QueryCriteria::like('CompanyService.Name', $name), QueryCriteria::like('CompanyService.Overview', $name), QueryCriteria::like('Company.Name', $name))));
}
if (!empty($service) || !empty($region)) {
$query->addAlias(QueryAlias::create('ServicesOffered'));
if (!empty($service)) {
$query->addAndCondition(QueryCriteria::like("ConsultantServiceOfferedType.Type", $service));
}
if (!empty($region)) {
$region_id = Region::get()->filter('Name', $region)->first()->ID;
$query->addAndCondition(QueryCriteria::id("Consultant_ServicesOffered.RegionID", $region_id));
}
}
if (is_array($location) && !empty($location[0])) {
$query->addAlias(QueryAlias::create('Offices'));
$query->addAndCondition(QueryCriteria::like("Office.City", $location[0]));
}
$countries = array_flip(Geoip::getCountryDropDown());
if (is_array($location) && count($location) == 2) {
$country = trim($location[1]);
if (!empty($country) && array_key_exists($country, $countries)) {
$query->addAndCondition(QueryCriteria::like("Office.Country", $countries[$country]));
}
} else {
if (is_array($location) && count($location) == 3) {
$state = trim($location[1]);
$country = trim($location[2]);
if (!empty($country) && array_key_exists($country, $countries)) {
$query->addAndCondition(QueryCriteria::like("Office.Country", $countries[$country]));
}
if (!empty($state)) {
$query->addAndCondition(QueryCriteria::like("Office.State", $state));
}
}
}
list($list, $size) = $this->consultants_repository->getAll($query, 0, 1000);
foreach ($list as $public_cloud) {
$output .= $public_cloud->renderWith('ConsultantsDirectoryPage_CloudBox', array('ConsultantLink' => $this->Link()));
}
} catch (Exception $ex) {
return $this->httpError(500, 'Server Error');
}
return empty($output) ? $this->httpError(404, '') : $output;
}
示例11: getTrainings
/**
* @return ITraining[]
*/
public function getTrainings()
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('ClassName', 'TrainingService'));
$query->addAndCondition(QueryCriteria::equal('Active', true));
$query = (string) $query;
return $this->owner->Services($query);
}
示例12: getAllPosted
/**
* @param int $offset
* @param int $limit
* @return array
*/
public function getAllPosted($offset = 0, $limit = 10)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('Active', 1));
$query->addAndCondition(QueryCriteria::greater('ExpirationDate', date('Y-m-d')));
$query->addOrder(QueryOrder::desc('JobPostedDate'));
return $this->getAll($query, $offset, $limit);
}
示例13: getByEventAndType
/**
* @param int $event_id
* @param string $seat_type
* @return IRSVP[]
*/
public function getByEventAndType($event_id, $seat_type = null)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('EventID', $event_id));
if ($seat_type) {
$query->addAndCondition(QueryCriteria::equal('SeatType', $seat_type));
}
return $this->getAll($query);
}
示例14: checkDuplicatedEntityCriteria
/**
* @param int $id
* @param array $params
* @return void
* @throws EntityAlreadyExistsException
*/
protected function checkDuplicatedEntityCriteria($id, array $params)
{
if (@$params['name']) {
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('Name', $params['name']));
$query->addAndCondition(QueryCriteria::notEqual('ID', $id));
$old_one = $this->repository->get($query);
if ($old_one) {
throw new EntityAlreadyExistsException($this->entity_class, sprintf('%s %s', 'name', $params['name']));
}
}
}
示例15: getByEventPaged
/**
* @param int $event_id
* @param int $page
* @param int $page_size
* @return IRSVP|null
*/
public function getByEventPaged($event_id, $page, $page_size)
{
$query = new QueryObject();
$query->addAndCondition(QueryCriteria::equal('EventID', $event_id));
$offset = ($page - 1) * $page_size;
return $this->getAll($query, $offset, $page_size);
}