当前位置: 首页>>代码示例>>PHP>>正文


PHP Location::setName方法代码示例

本文整理汇总了PHP中Location::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Location::setName方法的具体用法?PHP Location::setName怎么用?PHP Location::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Location的用法示例。


在下文中一共展示了Location::setName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildMerchants

 public function buildMerchants($xml)
 {
     $merchants = new Merchants();
     $merchants->setPageOffset((string) $xml->PageOffset);
     $merchants->setTotalCount((string) $xml->TotalCount);
     // merchant
     $merchantArray = array();
     foreach ($xml->Merchant as $merchant) {
         $tmpMerchant = new Merchant();
         $tmpMerchant->setId((string) $merchant->Id);
         $tmpMerchant->setName((string) $merchant->Name);
         $tmpMerchant->setWebsiteUrl((string) $merchant->WebsiteUrl);
         $tmpMerchant->setPhoneNumber((string) $merchant->PhoneNumber);
         $tmpMerchant->setCategory((string) $merchant->Category);
         $tmpLocation = new Location();
         $location = $merchant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         // ACCEPTANCE FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpAcceptance = new Acceptance();
         //$acceptance = $merchant->Acceptance;
         // FEATURES FRAMEWORK NEEDS LOOKED AT <RETURN XML AND DOC DOES NOT HAVE ALL VALUES>
         //$tmpFeatures = new Features();
         //$features =  $merchant->Features;
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpMerchant->setLocation($tmpLocation);
         array_push($merchantArray, $tmpMerchant);
     }
     $merchants->setMerchant($merchantArray);
     return $merchants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:51,代码来源:MerchantLocationService.php

示例2: buildAtms

 public function buildAtms($xml)
 {
     $atms = new Atms();
     $atms->setPageOffset($xml->PageOffset);
     $atms->setTotalCount($xml->TotalCount);
     $atmArray = array();
     foreach ($xml->Atm as $atm) {
         $tmpAtm = new Atm();
         $tmpAtm->setHandicapAccessible((string) $atm->HandicapAccessible);
         $tmpAtm->setCamera((string) $atm->Camera);
         $tmpAtm->setAvailability((string) $atm->Availability);
         $tmpAtm->setAccessFees((string) $atm->AccessFees);
         $tmpAtm->setOwner((string) $atm->Owner);
         $tmpAtm->setSharedDeposit((string) $atm->SharedDeposit);
         $tmpAtm->setSurchargeFreeAlliance((string) $atm->SurchargeFreeAlliance);
         $tmpAtm->setSponsor((string) $atm->Sponsor);
         $tmpAtm->setSupportEMV((string) $atm->SupportEMV);
         $tmpAtm->setSurchargeFreeAllianceNetwork((string) $atm->SurchargeFreeAllianceNetwork);
         $tmpLocation = new Location();
         $location = $atm->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpAtm->setLocation($tmpLocation);
         array_push($atmArray, $tmpAtm);
     }
     $atms->setAtm($atmArray);
     return $atms;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:49,代码来源:AtmLocationService.php

示例3: buildAtms

 public function buildAtms($xml)
 {
     $pageOffset = (string) $xml->PageOffset;
     $totalCount = (string) $xml->TotalCount;
     $restaurantArray = array();
     foreach ($xml->Restaurant as $restaurant) {
         $tmpRestaurant = new Restaurant();
         $tmpRestaurant->setId((string) $restaurant->Id);
         $tmpRestaurant->setName((string) $restaurant->Name);
         $tmpRestaurant->setWebsiteUrl((string) $restaurant->WebsiteUrl);
         $tmpRestaurant->setPhoneNumber((string) $restaurant->PhoneNumber);
         $tmpRestaurant->setCategory((string) $restaurant->Category);
         $tmpRestaurant->setLocalFavoriteInd((string) $restaurant->LocalFavoriteInd);
         $tmpRestaurant->setHiddenGemInd((string) $restaurant->HiddenGemInd);
         $tmpLocation = new Location();
         $location = $restaurant->Location;
         $tmpLocation->setName((string) $location->Name);
         $tmpLocation->setDistance((string) $location->Distance);
         $tmpLocation->setDistanceUnit((string) $location->DistanceUnit);
         $tmpAddress = new Address();
         $address = $location->Address;
         $tmpAddress->setLine1((string) $address->Line1);
         $tmpAddress->setLine2((string) $address->Line2);
         $tmpAddress->setCity((string) $address->City);
         $tmpAddress->setPostalCode((string) $address->PostCode);
         $tmpCountry = new Country();
         $tmpCountry->setName((string) $address->Country->Name);
         $tmpCountry->setCode((string) $address->Country->Code);
         $tmpCountrySubdivision = new CountrySubdivision();
         $tmpCountrySubdivision->setName((string) $address->CountrySubdivision->Name);
         $tmpCountrySubdivision->setCode((string) $address->CountrySubdivision->Code);
         $tmpAddress->setCountry($tmpCountry);
         $tmpAddress->setCountrySubdivision($tmpCountrySubdivision);
         $tmpPoint = new Point();
         $point = $location->Point;
         $tmpPoint->setLatitude((string) $point->Latitude);
         $tmpPoint->setLongitude((string) $point->Longitude);
         $tmpLocation->setPoint($tmpPoint);
         $tmpLocation->setAddress($tmpAddress);
         $tmpRestaurant->setLocation($tmpLocation);
         array_push($restaurantArray, $tmpRestaurant);
     }
     $restaurants = new Restaurants($pageOffset, $totalCount, $restaurantArray);
     return $restaurants;
 }
开发者ID:vicenteguerra,项目名称:Flashbuy,代码行数:45,代码来源:RestaurantsLocalFavoritesService.php

示例4: searchEmployees

 /**
  * Get employee list after sorting and filtering using given parameters.
  *
  * @param EmployeeSearchParameterHolder $parameterHolder
  */
 public function searchEmployees(EmployeeSearchParameterHolder $parameterHolder)
 {
     $sortField = $parameterHolder->getOrderField();
     $sortOrder = $parameterHolder->getOrderBy();
     $offset = $parameterHolder->getOffset();
     $limit = $parameterHolder->getLimit();
     $filters = $parameterHolder->getFilters();
     $returnType = $parameterHolder->getReturnType();
     $select = '';
     $query = '';
     $bindParams = array();
     $orderBy = '';
     $this->_getEmployeeListQuery($select, $query, $bindParams, $orderBy, $sortField, $sortOrder, $filters);
     $completeQuery = $select . ' ' . $query . ' ' . $orderBy;
     if (!is_null($offset) && !is_null($limit)) {
         $completeQuery .= ' LIMIT ' . $offset . ', ' . $limit;
     }
     if (sfConfig::get('sf_logging_enabled')) {
         $msg = $completeQuery;
         if (count($bindParams) > 0) {
             $msg .= ' (' . implode(',', $bindParams) . ')';
         }
         sfContext::getInstance()->getLogger()->info($msg);
     }
     $conn = Doctrine_Manager::connection();
     $statement = $conn->prepare($completeQuery);
     $result = $statement->execute($bindParams);
     if ($returnType == EmployeeSearchParameterHolder::RETURN_TYPE_OBJECT) {
         $employees = new Doctrine_Collection(Doctrine::getTable('Employee'));
         if ($result) {
             while ($row = $statement->fetch()) {
                 $employee = new Employee();
                 $employee->setEmpNumber($row['empNumber']);
                 $employee->setEmployeeId($row['employeeId']);
                 $employee->setFirstName($row['firstName']);
                 $employee->setMiddleName($row['middleName']);
                 $employee->setLastName($row['lastName']);
                 $employee->setTerminationId($row['terminationId']);
                 $jobTitle = new JobTitle();
                 $jobTitle->setId($row['jobTitleId']);
                 $jobTitle->setJobTitleName($row['jobTitle']);
                 $jobTitle->setIsDeleted($row['isDeleted']);
                 $employee->setJobTitle($jobTitle);
                 $employeeStatus = new EmploymentStatus();
                 $employeeStatus->setId($row['employeeStatusId']);
                 $employeeStatus->setName($row['employeeStatus']);
                 $employee->setEmployeeStatus($employeeStatus);
                 $workStation = new SubUnit();
                 $workStation->setName($row['subDivision']);
                 $workStation->setId($row['subDivisionId']);
                 $employee->setSubDivision($workStation);
                 $supervisorList = isset($row['supervisors']) ? $row['supervisors'] : '';
                 if (!empty($supervisorList)) {
                     $supervisors = new Doctrine_Collection(Doctrine::getTable('Employee'));
                     $supervisorArray = explode(',', $supervisorList);
                     foreach ($supervisorArray as $supervisor) {
                         list($first, $middle, $last) = explode('##', $supervisor);
                         $supervisor = new Employee();
                         $supervisor->setFirstName($first);
                         $supervisor->setMiddleName($middle);
                         $supervisor->setLastName($last);
                         $employee->supervisors[] = $supervisor;
                     }
                 }
                 $locationList = $row['locationIds'];
                 if (!empty($locationList)) {
                     //                    $locations = new Doctrine_Collection(Doctrine::getTable('EmpLocations'));
                     $locationArray = explode(',', $locationList);
                     foreach ($locationArray as $location) {
                         list($id, $name) = explode('##', $location);
                         $empLocation = new Location();
                         $empLocation->setId($id);
                         $empLocation->setName($name);
                         $employee->locations[] = $empLocation;
                     }
                 }
                 $employees[] = $employee;
             }
         }
     } else {
         return $statement->fetchAll();
     }
     return $employees;
 }
开发者ID:CamilleCrespeau,项目名称:orangehrm,代码行数:89,代码来源:EmployeeDao.php

示例5: testGetAccessibleLocationIds

 public function testGetAccessibleLocationIds()
 {
     $mockService = $this->getMock('LocationService');
     $locationList = new Doctrine_Collection('Location');
     for ($i = 0; $i < 3; $i++) {
         $location = new Location();
         $location->setId($i + 1);
         $location->setName("test name" . $i + 1);
         $locationList->add($location);
     }
     $mockService->expects($this->once())->method('getLocationList')->will($this->returnValue($locationList));
     $this->adminUserRole->setLocationService($mockService);
     $locationIds = $this->adminUserRole->getAccessibleLocationIds(null, null);
     $this->assertEquals($locationIds, array(1, 2, 3));
 }
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:15,代码来源:AdminUserRoleTest.php

示例6: dirname

<?php

include dirname(__FILE__) . '/../bootstrap/dbunit.php';
$t = new lime_test(4, new lime_output_color());
$extractor = new afColumnExtractor('Server', array('name', 'alert_interval', 'updated_at', 'location_id', 'server_type_id', 'is_enabled', 'osversion', 'html_is_enabled'));
$location = new Location();
$location->setName('myLocation');
$server = new Server();
$server->setName('localhost');
$server->setOsversion('my <version>');
$server->setAlertInterval(300);
$date = '2010-02-14 03:25:45';
$server->setUpdatedAt($date);
$server->setLocation($location);
$server->setIsEnabled(true);
$objects = array($server);
$rows = $extractor->extractColumns($objects);
$row = $rows[0];
$t->like($row['is_enabled'], '@^<img src=\'/images/famfamfam/accept.png\' .*@');
$t->is($row['html_is_enabled'], $row['is_enabled']);
unset($row['is_enabled']);
unset($row['html_is_enabled']);
$expected = array('name' => 'localhost', 'alert_interval' => 300, 'updated_at' => $date, 'location_id' => 'myLocation', 'server_type_id' => null, 'osversion' => 'my &lt;version&gt;');
$t->is($row, $expected);
$t->is(json_encode($row), json_encode($expected));
开发者ID:cbsistem,项目名称:appflower_engine,代码行数:25,代码来源:afColumnExtractorTest.php


注:本文中的Location::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。