本文整理汇总了PHP中QueryObject类的典型用法代码示例。如果您正苦于以下问题:PHP QueryObject类的具体用法?PHP QueryObject怎么用?PHP QueryObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QueryObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: findByDupeAccount
/**
* @param string $dupe_account_email
* @return IDupeMemberActionAccountRequest
*/
public function findByDupeAccount($dupe_account_email)
{
$query = new QueryObject(new $this->entity_class());
$query->addAlias(QueryAlias::create('DupeAccount'));
$query->addAndCondition(QueryCriteria::equal('Member.Email', $dupe_account_email));
return $this->getBy($query);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:11,代码来源:SapphireDupeMemberActionAccountRequestRepository.php
示例2: 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);
}
开发者ID:rbowen,项目名称:openstack-org,代码行数:12,代码来源:SapphireDupesMemberRepository.php
示例3: 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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:7,代码来源:SapphireEventFeedbackRepository.php
示例4: getLatestNElections
/**
* @param int $n
* @return IElection[]
*/
public function getLatestNElections($n)
{
$query = new QueryObject(new Election());
$query->addOrder(QueryOrder::desc('ElectionsOpen'));
list($list, $count) = $this->getAll($query, 0, $n);
return $list;
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:11,代码来源:SapphireElectionRepository.php
示例5: getSteps
/**
* @return ISurveyStep[]
*/
public function getSteps()
{
$query = new QueryObject(new SurveyStep());
$query->addAlias(QueryAlias::create('Template'));
$query->addOrder(QueryOrder::asc('Template.Order'));
return new ArrayList(AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Steps', $query)->toArray());
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:10,代码来源:Survey.php
示例6: isScheduled
/**
* @return bool
*/
public function isScheduled($event_id)
{
$query = new QueryObject($this);
$query->addAndCondition(QueryCriteria::equal('SummitEvent.ID', $event_id));
$events = AssociationFactory::getInstance()->getMany2ManyAssociation($this, 'Schedule', $query)->toArray();
return count($events) > 0;
}
开发者ID:rbowen,项目名称:openstack-org,代码行数:10,代码来源:SummitAttendee.php
示例7: testShouldReturnQuerySelectWithOrderStatement
public function testShouldReturnQuerySelectWithOrderStatement()
{
$query = new QueryObject($table = 'users');
$expected = "SELECT * FROM users ORDER BY name;";
$result = $query->select()->where("name = 'TestName'")->where("age = 18")->order("name")->toString();
$this->assertEquals($expected, $result);
}
开发者ID:amaivsimau,项目名称:dojos,代码行数:7,代码来源:QueryObjectTest.php
示例8: addQuestion
/**
* @param ISurveyQuestionTemplate $question
* @return $this
*/
public function addQuestion(ISurveyQuestionTemplate $question)
{
$query = new QueryObject();
$query->addOrder(QueryOrder::asc('Order'));
return AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'Questions', $query)->add($question);
return $this;
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:11,代码来源:SurveyRegularStepTemplate.php
示例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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SapphireTeamRepository.php
示例10: 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);
}
开发者ID:Thingee,项目名称:openstack-org,代码行数:13,代码来源:SapphireCLAMemberRepository.php
示例11: exportCCLACompanies
public function exportCCLACompanies()
{
//clean output buffer
ob_end_clean();
// file name for download
$filename = "companies_ccla" . date('Ymd') . ".xls";
header("Content-Disposition: attachment; filename=\"{$filename}\"");
header("Content-Type: application/vnd.ms-excel");
$query = new QueryObject();
$query->addOrder(QueryOrder::asc('Name'));
list($list, $size) = $this->company_repository->getAll($query, 0, 1000);
$data = array();
foreach ($list as $company) {
$row = array();
$row['CompanyName'] = $company->Name;
$row['CCLADate'] = $company->isICLASigned() ? $company->CCLADate : 'N/A';
$row['CCLASigned'] = $company->isICLASigned() ? 'True' : 'False';
array_push($data, $row);
}
$flag = false;
foreach ($data as $row) {
if (!$flag) {
// display field/column names as first row
echo implode("\t", array_keys($row)) . "\n";
$flag = true;
}
array_walk($row, array($this, 'cleanData'));
echo implode("\t", array_values($row)) . "\n";
}
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:30,代码来源:SangriaPageICLACompaniesExtension.php
示例12: 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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SapphireTeamInvitationRepository.php
示例13: getNominationsByNominee
public function getNominationsByNominee($member_id, $offset = 0, $limit = 10)
{
$query = new QueryObject(new CandidateNomination());
$query->addAlias(QueryAlias::create('Candidate'));
$query->addAndCondition(QueryCriteria::equal('Member.ID', $member_id));
return $this->getAll($query, $offset, $limit);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:7,代码来源:SapphireCandidateNominationRepository.php
示例14: 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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SapphireSurveyRepository.php
示例15: 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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SapphireJobRegistrationRequestRepository.php
示例16: getAllApproved
/**
* @param int $offset
* @param int $limit
* @return array
*/
public function getAllApproved($offset = 0, $limit = 100)
{
$query = new QueryObject(new MarketPlaceReview());
$query->addAndCondition(QueryCriteria::equal('Approved', 1));
$query->addOrder(QueryOrder::desc('Created'));
return $this->getAll($query, $offset, $limit);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:12,代码来源:SapphireReviewRepository.php
示例17: 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);
}
开发者ID:hogepodge,项目名称:openstack-org,代码行数:13,代码来源:SapphireRSVPRepository.php
示例18: 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;
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:59,代码来源:Consultants_Controller.php
示例19: 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);
}
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:11,代码来源:MarketPlaceCompany.php
示例20: 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);
}
开发者ID:rbowen,项目名称:openstack-org,代码行数:13,代码来源:SapphireJobRepository.php
注:本文中的QueryObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论