本文整理匯總了PHP中DbUtils::getDbValues方法的典型用法代碼示例。如果您正苦於以下問題:PHP DbUtils::getDbValues方法的具體用法?PHP DbUtils::getDbValues怎麽用?PHP DbUtils::getDbValues使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DbUtils
的用法示例。
在下文中一共展示了DbUtils::getDbValues方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
public function run()
{
$userIds = null;
if ($this->messages) {
foreach ($this->messages as $message) {
$userIds[] = $message->from_user_id;
}
}
$first_name = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'first_name');
$last_name = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'last_name');
$this->render('pmbInbox', array('messages' => $this->messages, 'first_name' => $first_name, 'last_name' => $last_name, 'unread' => $this->unread, 'pages' => $this->pages));
}
示例2: actionView
public function actionView($id)
{
Yii::beginProfile('requirements_view');
//$requirements=RequirementApi::getRequirementByUserId(Yii::app()->user->id);
//$this->render('view',array('requirements'=>$requirements));
$session = Yii::app()->session;
$requirement = RequirementApi::getRequirementById($id);
if (!$requirement) {
throw new CHttpException(404, 'The requested page does not exist.');
}
$userDetails = UserApi::getUserProfileDetails($requirement->user_id);
$propertyIds = RequirementPropertyTypesApi::getPropertyTypesByRequirementId($id);
$properties = "";
$propertyNames = "";
if ($propertyIds) {
foreach ($propertyIds as $propertyId) {
$properties[] = $propertyId->property_type_id;
}
$propertyNames = DbUtils::getDbValues(new PropertyTypes(), 'id', $properties, 'property_type');
}
$amenityIds = RequirementAmenitiesApi::getAmenitiesByRequirementId($id);
$amenities = "";
$amenityNames = "";
if ($amenityIds) {
foreach ($amenityIds as $amenityId) {
$amenities[] = $amenityId->amenity_id;
}
$amenityNames = DbUtils::getDbValues(new CategoryAmenities(), 'id', $amenities, 'amenity');
}
$cityIds = RequirementCitiesApi::getCitiesByRequirementId($id);
$cities = "";
$cityNames = "";
if ($cityIds) {
foreach ($cityIds as $cityId) {
$cities[] = $cityId->city_id;
}
$cityNames = DbUtils::getDbValues(new GeoCity(), 'id', $cities, 'city');
}
$bedroomsRequirement = RequirementBedroomsApi::getBedroomsByRequirementId($id);
$this->render('view', array('requirement' => $requirement, 'amenityNames' => $amenityNames, 'cityNames' => $cityNames, 'propertyNames' => $propertyNames, 'bedroomsRequirement' => $bedroomsRequirement, 'userDetails' => $userDetails));
Yii::endProfile('requirements_view');
}
示例3: actionIndex
public function actionIndex()
{
$userId = Yii::app()->user->id;
$projectImages = '';
$propertyImages = '';
$projectCount = '';
$propertyCount = '';
$propertyTypes = '';
$propertyLocations = '';
$propertyid = '';
$projectLocations = '';
$projectOwnerships = '';
$projectTypes = '';
$users = '';
$userIds[] = '';
$myJukeBox = '';
$jukeBoxcategoryName = '';
$jukecount = '0';
$propertyWishList = '';
$propertyName = '';
$projectWishlist = '';
$projectName = '';
$propertywishlistcount = 0;
$inbox = PmbApi::getInbox($userId);
$userName = UserApi::getUserProfileDetails($userId);
if ($inbox) {
foreach ($inbox as $messages) {
$userIds[] = $messages->from_user_id;
}
$users = DbUtils::getDbValues(new UserProfiles(), 'user_id', $userIds, 'first_name');
}
$properties = PropertyApi::getPropertiesOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
$countUnread = PmbApi::getUnreadInboxCount($userId);
$propertyCount = PropertyApi::getAllPropertiesCount($userId);
$locations = '';
if ($properties) {
foreach ($properties as $location) {
$locations[] = $location->city_id;
}
$propertyLocations = DbUtils::getDbValues(new GeoCity(), 'id', $locations, 'city');
}
if ($properties) {
foreach ($properties as $property) {
$propertyTypes[] = $property->property_type_id;
$propertyid[] = $property->id;
}
$propertyImages = PropertyImagesApi::getPrimaryImageForProperties($propertyid);
$propertyTypes = DbUtils::getDbValues(new PropertyTypes(), 'id', $propertyTypes, 'property_type');
}
$projects = ProjectApi::getProjectsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
if ($projects) {
foreach ($projects as $project) {
$projectLocationIds[] = $project->city_id;
$projectTypeIds[] = $project->project_type_id;
$projectOwnershipIds[] = $project->ownership_type_id;
$projectIds[] = $project->id;
}
$projectImages = ProjectImagesApi::getPrimaryImageForProjects($projectIds);
$projectLocations = DbUtils::getDbValues(new GeoCity(), 'id', $projectLocationIds, 'city');
$projectTypes = DbUtils::getDbValues(new ProjectTypes(), 'id', $projectTypeIds, 'project_type');
$projectOwnerships = DbUtils::getDbValues(new CategoryOwnershipTypes(), 'id', $projectOwnershipIds, 'ownership_type');
}
$projectCount = ProjectApi::getProjectsofUserCount($userId);
$isProfile['agent'] = AgentProfileApi::isAgent($userId);
$isProfile['builder'] = BuilderProfileApi::isBuilder($userId);
$isProfile['specialist'] = SpecialistProfileApi::isSpecialist($userId);
//MyJuckbox
$myJukeBox = JukeboxQuestionsApi::getAllJukeboxQuestionsOfUser($userId, Yii::app()->params['dashboardResultsPerPage']);
if ($myJukeBox) {
foreach ($myJukeBox as $jukeBox) {
$categoryIdArray[] = $jukeBox->category_id;
}
$jukeBoxcategoryName = DbUtils::getDbValues(new JukeboxCategory(), 'id', $categoryIdArray, 'category');
$jukecount = count($myJukeBox);
}
//my wishlists
$propertyWishList = PropertyWishlistApi::getWishlist($userId, Yii::app()->params['dashboardResultsPerPage']);
if ($propertyWishList) {
foreach ($propertyWishList as $propertyWish) {
$propertyWishlistArray[] = $propertyWish->property_id;
}
$propertyName = DbUtils::getDbValues(new Property(), 'id', $propertyWishlistArray, 'property_name');
}
$propertywishlistcount = PropertyWishlistApi::getWishlistCount($userId);
$totalWishlistCount = $propertywishlistcount;
//+$projectwishlistcount;
//requirements
$requirements = RequirementApi::getRequirementByUserId($userId, Yii::app()->params['dashboardResultsPerPage']);
if ($requirements) {
$requirementscount = count($requirements);
} else {
$requirementscount = 0;
}
$this->render('index', array('inbox' => $inbox, 'users' => $users, 'properties' => $properties, 'countUnread' => $countUnread, 'propertyLocations' => $propertyLocations, 'propertyTypes' => $propertyTypes, 'projects' => $projects, 'projectLocations' => $projectLocations, 'projectTypes' => $projectTypes, 'projectOwnerships' => $projectOwnerships, 'propertyCount' => $propertyCount, 'projectCount' => $projectCount, 'propertyid' => $propertyid, 'propertyImages' => $propertyImages, 'projectImages' => $projectImages, 'isProfile' => $isProfile, 'myJukeBox' => $myJukeBox, 'jukeBoxcategoryName' => $jukeBoxcategoryName, 'jukecount' => $jukecount, 'propertyWishList' => $propertyWishList, 'propertyName' => $propertyName, 'projectName' => $projectName, 'totalWishlistCount' => $totalWishlistCount, 'requirements' => $requirements, 'requirementscount' => $requirementscount, 'userName' => $userName));
}
示例4: foreach
echo $specialistProfile->email;
?>
</p>
<br class="clear" />
</td>
</tr>
</table>
<br class="clear" />
<?php
if ($specialistProjects) {
$specialistIds = null;
foreach ($specialistProjects as $specialistProject) {
$specialistIds[] = $specialistProject->specialist_type_id;
}
$specialists = DbUtils::getDbValues(new Specializations(), 'id', $specialistIds, 'specialist');
echo '<div class="specialist_project_details"><h1>Project Details</h1><ul>';
foreach ($specialistProjects as $specialistProject) {
echo '<li><img src="images/photo1.jpg" alt="" class="left" />
<div class="right" style="width:550px;">
<h2>' . $specialistProject->project_name . '</h2>
<p class="red-txt"><b>' . $specialists[$specialistProject->specialist_type_id] . '</b> </p>
<p>' . $specialistProject->description . '</p>
</div>
<br class="clear" />
</li>';
}
echo '</ul></div>';
}
?>
</div>
示例5: getAmenitiesById
public static function getAmenitiesById($amenitiesId)
{
return DbUtils::getDbValues(new CategoryAmenities(), 'id', $amenitiesId, 'amenity ');
$models = CategoryAmenities::model()->findAllBySql("SELECT * FROM category_amenities where id IN\n\t\t(SELECT amenity_id FROM property_amenities WHERE property_id=:propertyId)", array(':propertyId' => $propertyId));
}