本文整理汇总了PHP中Address::setStreet方法的典型用法代码示例。如果您正苦于以下问题:PHP Address::setStreet方法的具体用法?PHP Address::setStreet怎么用?PHP Address::setStreet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::setStreet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fromArray
public static function fromArray($data)
{
$address = new Address();
if (isset($data['street'])) {
$address->setStreet($data['street']);
}
if (isset($data['street2'])) {
$address->setStreet2($data['street2']);
}
if (isset($data['zip'])) {
$address->setZip($data['zip']);
}
if (isset($data['city'])) {
$address->setCity($data['city']);
}
if (isset($data['country'])) {
$address->setCountry($data['country']);
}
if (isset($data['state'])) {
$address->setState($data['state']);
}
if (isset($data['tel'])) {
$address->setTel($data['tel']);
}
if (isset($data['fax'])) {
$address->setFax($data['fax']);
}
if (isset($data['email'])) {
$address->setEmail($data['email']);
}
return $address;
}
示例2: getAsObject
protected function getAsObject($row)
{
$result = new Address();
$result->setNew(false);
$result->setAddressId(Singleton::create("NullConverter")->fromDBtoDOM($row["addressId"]));
$result->setStreet(Singleton::create("NullConverter")->fromDBtoDOM($row["street"]));
$result->setLocation(Singleton::create("NullConverter")->fromDBtoDOM($row["location"]));
return $result;
}
示例3: testPopulateWithPlace
public function testPopulateWithPlace()
{
$point = new Point();
$point->setLat('-23.59243454');
$point->setLng('-46.68677054');
$city = new City();
$city->setCountry('BR');
$city->setState('SP');
$city->setName('São Paulo');
$category = new Category();
$category->setId('123');
$category->setName('Empresas de Internet');
$address = new Address();
$address->setStreet("Rua Funchal");
$address->setNumber(129);
$address->setComplement('6o andar');
$address->setCity($city);
$place = new Place();
$place->setId("M25GJ288");
$place->setName("Apontador.com - São Paulo");
$place->setDescription("Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br).");
$place->setIconUrl("http://localphoto.s3.amazonaws.com/C40372534F143O1437_9896391605729015_l.jpg");
$place->setPoint($point);
$place->setCategory($category);
$place->setAddress($address);
$this->og->populate($place);
$rootUrl = \ROOT_URL;
$testMeta = <<<META
\t<meta property="og:title" content="Apontador.com - São Paulo"/>
\t<meta property="og:description" content="Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br)."/>
\t<meta property="og:image" content="http://maplink.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054"/>
\t<meta property="og:url" content="{$rootUrl}sp/s-o-paulo/empresas-de-internet/apontador-com-s-o-paulo/M25GJ288.html"/>
\t<meta property="og:street-address" content="Rua Funchal, 129"/>
\t<meta property="og:locality" content="São Paulo"/>
\t<meta property="og:region" content="SP"/>
\t<meta property="og:country-name" content="Brasil"/>
\t<meta property="og:latitude" content="-23.59243454"/>
\t<meta property="og:longitude" content="-46.68677054"/>
\t<meta property="og:type" content="company"/>
META;
$this->assertEquals($testMeta, $this->og->getMeta());
$testArray = array('title' => 'Apontador.com - São Paulo', 'description' => 'Líder em geolocalização no Brasil e uma das 250 maiores empresas de internet do mundo, segundo o AlwaysOn, o Apontador (www.apontador.com) desenvolve e oferece serviços e ferramentas de busca e localização para facilitar o dia a dia dos usuários, além de mostrar a opinião do público para os locais cadastrados em seus sites. Com mais de 10 milhões de visitantes mensais, a empresa inclui o site líder em busca local Apontador (www.apontador.com.br) e o de mapas e rotas MapLink (www.maplink.com.br).', 'image' => 'http://maplink.apontador.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054', 'url' => ROOT_URL . 'sp/s-o-paulo/empresas-de-internet/apontador-com-s-o-paulo/M25GJ288.html', 'street-address' => 'Rua Funchal, 129', 'locality' => 'São Paulo', 'region' => 'SP', 'country-name' => 'Brasil', 'latitude' => '-23.59243454', 'longitude' => '-46.68677054', 'type' => 'company');
$this->assertEquals($testArray, $this->og->getArray());
}
示例4: testPopulateWithPlace
public function testPopulateWithPlace()
{
$point = new Point();
$point->setLat('-23.59243454');
$point->setLng('-46.68677054');
$city = new City();
$city->setCountry('BR');
$city->setState('SP');
$city->setName('São Paulo');
$category = new Category();
$category->setId('067');
$category->setName('Restaurante');
$address = new Address();
$address->setStreet("R. Min. Jesuino Cardoso");
$address->setNumber(473);
$address->setCity($city);
$place = new Place();
$place->setId("UCV34B2P");
$place->setName("Uziel Restaurante");
$place->setDescription("Se você procura um restaurante com variedade, qualidade com preço justo você encontra no Uziel restaurante!O preço do kilo é R\$ 26,90, mas você paga no máximo R\$ 15,90 por pesagem de refeições (excluindo sobremesas, bebidas e doces). Acima de 500 gramas você ainda ganha um refrescoUm bom vinho, gelatina e cafezinho são por nossa conta.Se precisar de internet você pode contar com nossa rede Wi-Fi.Nosso cardápio diário possui 5 tipos de carne todos os dias, feijoada completa e separada (feijão e carnes) às quartas, 6 tipos de massa nas quintas e 4 tipos de pizzas nassextas, além de opções de peixes todas as terças e sextas.Oferecemos convênio com descontos progressivos para empresas e um bolo com o sabor a escolha do aniversariante, caso agende com antecedência e traga mais de 10 pessoas para almoçar no seu aniversário.Aceitamos todos os cartões de crédito e vales refeição.Você pode receber nosso cardápio atualizado diariamente pelo twitter http://twitter.com/uzielrestaurant");
$place->setIconUrl("http://maplink.com.br/widget?v=4.1&lat=-23.5926083&lng=-46.6818329");
$place->setPoint($point);
$place->setCategory($category);
$place->setAddress($address);
$this->abm->populate($place);
$rootUrl = \ROOT_URL;
$testMeta = <<<META
\t<meta property="restaurant:title" content="Uziel Restaurante"/>
\t<meta property="restaurant:description" content="Se você procura um restaurante com variedade, qualidade com preço justo você encontra no Uziel restaurante!O preço do kilo é R\$ 26,90, mas você paga no máximo R\$ 15,90 por pesagem de refeições (excluindo sobremesas, bebidas e doces). Acima de 500 gramas você ainda ganha um refrescoUm bom vinho, gelatina e cafezinho são por nossa conta.Se precisar de internet você pode contar com nossa rede Wi-Fi.Nosso cardápio diário possui 5 tipos de carne todos os dias, feijoada completa e separada (feijão e carnes) às quartas, 6 tipos de massa nas quintas e 4 tipos de pizzas nassextas, além de opções de peixes todas as terças e sextas.Oferecemos convênio com descontos progressivos para empresas e um bolo com o sabor a escolha do aniversariante, caso agende com antecedência e traga mais de 10 pessoas para almoçar no seu aniversário.Aceitamos todos os cartões de crédito e vales refeição.Você pode receber nosso cardápio atualizado diariamente pelo twitter http://twitter.com/uzielrestaurant"/>
\t<meta property="restaurant:image" content="http://maplink.apontador.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054"/>
\t<meta property="restaurant:url" content="{$rootUrl}sp/s-o-paulo/restaurante/uziel-restaurante/UCV34B2P.html"/>
\t<meta property="restaurant:address" content="R. Min. Jesuino Cardoso, 473"/>
\t<meta property="restaurant:city" content="São Paulo"/>
\t<meta property="restaurant:state" content="SP"/>
\t<meta property="restaurant:country-name" content="Brasil"/>
\t<meta property="restaurant:type" content="restaurant"/>
META;
$this->assertEquals($testMeta, $this->abm->getMeta());
$testArray = array('title' => 'Uziel Restaurante', 'description' => 'Se você procura um restaurante com variedade, qualidade com preço justo você encontra no Uziel restaurante!O preço do kilo é R$ 26,90, mas você paga no máximo R$ 15,90 por pesagem de refeições (excluindo sobremesas, bebidas e doces). Acima de 500 gramas você ainda ganha um refrescoUm bom vinho, gelatina e cafezinho são por nossa conta.Se precisar de internet você pode contar com nossa rede Wi-Fi.Nosso cardápio diário possui 5 tipos de carne todos os dias, feijoada completa e separada (feijão e carnes) às quartas, 6 tipos de massa nas quintas e 4 tipos de pizzas nassextas, além de opções de peixes todas as terças e sextas.Oferecemos convênio com descontos progressivos para empresas e um bolo com o sabor a escolha do aniversariante, caso agende com antecedência e traga mais de 10 pessoas para almoçar no seu aniversário.Aceitamos todos os cartões de crédito e vales refeição.Você pode receber nosso cardápio atualizado diariamente pelo twitter http://twitter.com/uzielrestaurant', 'image' => 'http://maplink.apontador.com.br/widget?v=4.1&lat=-23.59243454&lng=-46.68677054', 'url' => ROOT_URL . 'sp/s-o-paulo/restaurante/uziel-restaurante/UCV34B2P.html', 'address' => 'R. Min. Jesuino Cardoso, 473', 'city' => 'São Paulo', 'state' => 'SP', 'country-name' => 'Brasil', 'type' => 'restaurant');
$this->assertEquals($testArray, $this->abm->getArray());
}
示例5: map
public static function map(Address $address, array $properties)
{
if (array_key_exists('id', $properties)) {
$address->setId($properties['id']);
}
if (array_key_exists('street', $properties)) {
$address->setStreet($properties['street']);
}
if (array_key_exists('suburb', $properties)) {
$address->setSuburb($properties['suburb']);
}
if (array_key_exists('city', $properties)) {
$address->setCity($properties['city']);
}
if (array_key_exists('post_code', $properties)) {
$address->setPostCode($properties['post_code']);
}
if (array_key_exists('street_no', $properties)) {
$address->setstreetNo($properties['street_no']);
}
}
示例6: testSetAddressParameters
/**
* @group shopobjects
*/
function testSetAddressParameters()
{
// GIVEN
$incompleteAddressParameter = $this->givenIncompleteAddressParameter();
// WHEN
$address = new Address($incompleteAddressParameter);
$address->setBirthday("01.02.1900");
$address->setCity("Cologne");
$address->setCompany("FakeCompany");
$address->setCountry("England");
$address->setEmailAddress("a@b.cd");
$address->setFirstName("Max");
$address->setLastName("Miller");
$address->setSalutation("Mr.");
$address->setState("NRW");
$address->setStreet("First street 2");
$address->setStreetDetails("c/o Mister Smith");
$address->setTitle("Master");
$address->setVatId("DE1234567890");
$address->setZipCode("12345");
// THEN
$this->assertFalse($address->error());
$this->thenCompleteAddressInformationIsExisting($address);
}
示例7: executeConfirmStudent
//.........这里部分代码省略.........
$student = StudentPeer::retrieveByDocumentTypeAndNumber($s_identification_type, $s_identification_number);
$con->beginTransaction();
if (is_null($student)) {
//el alumno no existe. Creo la persona y el alumno
$s_person = new Person();
$s_person->setLastname($s_lastname);
$s_person->setFirstname($s_firstname);
$s_person->setSex($s_sex);
$s_person->setIdentificationType($s_identification_type);
$s_person->setIdentificationNumber($s_identification_number);
$s_person->setPhone($s_phone);
$s_person->setBirthdate($s_birthdate);
$s_person->setIsActive(true);
$s_person->setBirthCity($s_birth_city);
$s_person->save(Propel::getConnection());
$student = new Student();
$student->setPerson($s_person);
$student->setGlobalFileNumber('888888');
//Nro de legajo??
$student->setOriginSchoolId($s_origin_school_id);
$student->setHealthCoverageId($s_health_coverage_id);
$student->save(Propel::getConnection());
/* Recupero department, state ,country*/
if (!is_null($s_birth_city)) {
$city = CityPeer::retrieveByPk($s_birth_city);
$student->getPerson()->setBirthCountry($city->getDepartment()->getState()->getCountry()->getId());
$student->getPerson()->setBirthState($city->getDepartment()->getState()->getId());
$student->getPerson()->setBirthDepartment($city->getDepartment()->getId());
}
//chequeo domicilio
if (!is_null($s_city) || !is_null($s_street) || !is_null($s_number) || !is_null($s_floor) || is_null($s_flat)) {
$a = new Address();
$a->setCityId($s_city);
$a->setStreet($s_street);
$a->setNumber($s_number);
$a->setFloor($s_floor);
$a->setFlat($s_flat);
$student->getPerson()->setAddress($a);
$student->getPerson()->save(Propel::getConnection());
$data['message'] = "El alumno ha sido confirmado.";
}
} else {
//seteo isActive
$student->getPerson()->setIsActive(true);
$student->save(Propel::getConnection());
$data['message'] = "El alumno fue actualizado correctamente.";
}
//chequeo campos obligatorios
if (!is_null($m_identification_type) && !is_null($m_identification_number) && !is_null($m_lastname) && trim($m_lastname) != "" && !is_null($m_firstname) && trim($m_firstname) != "") {
//busco si ya existe.
$m_tutor = TutorPeer::findByDocumentTypeAndNumber($m_identification_type, $m_identification_number);
if (is_null($m_tutor)) {
//el tutor no existe. Lo creo
$m_person = new Person();
$m_person->setLastname($m_lastname);
$m_person->setFirstname($m_firstname);
$m_person->setIdentificationType($m_identification_type);
$m_person->setIdentificationNumber($m_identification_number);
$m_person->setSex(SexType::FEMALE);
$m_person->setPhone($m_phone);
$m_person->setEmail($m_email);
$m_person->setBirthdate($m_birthdate);
$m_person->setIsActive(true);
$m_person->setBirthCity($m_birth_city);
$m_person->save(Propel::getConnection());
$m_tutor = new Tutor();
示例8: getBeanFromRequest
/**
* Populates the Venue object from the request
* @return bean Venue
*/
private function getBeanFromRequest()
{
$venue = new Venue();
$addr = new Address();
$addr->setOid($_REQUEST['aoid']);
$addr->setStreet($_REQUEST['street']);
$addr->setUnit($_REQUEST['unit']);
$addr->setCity($_REQUEST['city']);
$addr->setState($_REQUEST['state']);
$addr->setPostalCode($_REQUEST['postalCode']);
$addr->setPhone($_REQUEST['phone']);
$venue->setOid($_REQUEST['oid']);
$venue->setName($_REQUEST['name']);
$venue->setDescription($_REQUEST['description']);
$venue->setPubState($_REQUEST['pubState']);
$venue->setAddress($addr);
if (isset($_REQUEST['gallery'])) {
$venue->setGallery($_REQUEST['gallery']);
}
$links = array();
//$links['exhibition'] = $_REQUEST['exhibition'];
//$links['program'] = isset($_REQUEST['program']) ? $_REQUEST['program'] : null;
//$links['course'] = isset($_REQUEST['course']) ? $_REQUEST['course'] : null;
$venue->setEvents($links);
return $venue;
}
示例9: testPopulate
public function testPopulate()
{
$subCategory = new Subcategory();
$subCategory->setId(1234);
$subCategory->setName("Self Service");
$category = new Category();
$category->setId(12);
$category->setName("Restaurantes");
$category->setSubCategory($subCategory);
$city = new City();
$city->setCountry("Brasil");
$city->setState("SP");
$city->setName("São Paulo");
$address = new Address();
$address->setCity($city);
$address->setComplement("1 Andar");
$address->setDistrict("Vila Olímpia");
$address->setNumber("129");
$address->setStreet("Rua Funchal");
$address->setZipcode("04551-069");
$gasStation = new GasStation(array('price_gas' => 1, 23, 'price_vodka' => 23, 45));
$placeInfo = new PlaceInfo();
$placeInfo->setGasStation($gasStation);
$data = new \stdClass();
$data->id = 123;
$data->name = "Chegamos!";
$data->average_rating = 4;
$data->review_count = 3;
$data->category = $category;
$data->subcategory = $subCategory;
$data->address = $address;
$data->point->lat = "-23.529366";
$data->point->lng = "-47.467117";
$data->main_url = "http://chegamos.com/";
$data->other_url = "http://chegamos.com.br/";
$data->icon_url = "http://chegamos.com/img/icon.png";
$data->description = "Description";
$data->created = "01/12/2010 16:19";
$data->phone = "11 2222-3333";
$data->extended = $placeInfo;
$data->num_visitors = 1024;
$data->num_photos = 5;
$this->object->populate($data);
$this->assertEquals(123, $this->object->getId());
$this->assertEquals("Chegamos!", $this->object->getName());
$this->assertEquals(4, $this->object->getAverageRating());
$this->assertEquals("Bom", $this->object->getAverageRatingString());
$this->assertEquals(3, $this->object->getReviewCount());
$this->assertEquals("app\\models\\Category", \get_class((object) $this->object->getCategory()));
$this->assertEquals("Restaurantes - Self Service", (string) $this->object->getCategory());
$this->assertEquals("app\\models\\Address", \get_class((object) $this->object->getAddress()));
$this->assertEquals("Rua Funchal, 129 - Vila Olímpia<br/>São Paulo - SP", (string) $this->object->getAddress());
$this->assertEquals("-23.529366,-47.467117", (string) $this->object->getPoint());
$this->assertEquals("http://chegamos.com/", $this->object->getMainUrl());
$this->assertEquals("http://chegamos.com.br/", $this->object->getOtherUrl());
$this->assertEquals("http://chegamos.com/img/icon.png", $this->object->getIconUrl());
$this->assertEquals("Description", $this->object->getDescription());
$this->assertEquals("01/12/2010 16:19", $this->object->getCreated());
$this->assertEquals("11 2222-3333", $this->object->getPhone());
$this->assertEquals("app\\models\\PlaceInfo", \get_class((object) $this->object->getPlaceInfo()));
$this->assertEquals(1024, $this->object->getNumVisitors());
$this->assertEquals(5, $this->object->getNumPhotos());
}
示例10: Main
function Main()
{
switch ($this->formArray["formAction"]) {
case "edit":
$CompanyDetails = new SoapObject(NCCBIZ . "CompanyDetails.php", "urn:Object");
if (!($xmlStr = $CompanyDetails->getCompanyDetails($this->formArray["companyID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$company = new Company();
$company->parseDomDocument($domDoc);
$this->formArray["companyID"] = $company->getCompanyID();
$this->formArray["companyName"] = $company->getCompanyName();
$this->formArray["tin"] = $company->getTin();
$this->formArray["telephone"] = $company->getTelephone();
$this->formArray["fax"] = $company->getFax();
$address = $company->addressArray[0];
if (is_a($address, Address)) {
$this->formArray["addressID"] = $address->getAddressID();
$this->formArray["number"] = $address->getNumber();
$this->formArray["street"] = $address->getStreet();
$this->formArray["barangay"] = $address->getBarangay();
$this->formArray["district"] = $address->getDistrict();
$this->formArray["municipalityCity"] = $address->getMunicipalitycity();
$this->formArray["province"] = $address->getProvince();
}
$this->formArray["email"] = $company->getEmail();
$this->formArray["website"] = $company->getWebsite();
}
}
break;
case "save":
$CompanyEncode = new SoapObject(NCCBIZ . "CompanyEncode.php", "urn:Object");
if ($this->formArray["companyID"] != "") {
$CompanyDetails = new SoapObject(NCCBIZ . "CompanyDetails.php", "urn:Object");
if (!($xmlStr = $CompanyDetails->getCompanyDetails($this->formArray["companyID"]))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "record not found");
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "Table", "TableBlock");
$this->tpl->set_var("TableBlock", "error xmlDoc");
} else {
$company = new Company();
$company->parseDomDocument($domDoc);
$address = $company->addressArray[0];
if (is_a($address, Address)) {
$address->setAddressID($this->formArray["addressID"]);
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
}
//$company->selectRecord($this->formArray["companyID"]);
$company->setCompanyID($this->formArray["companyID"]);
$company->setCompanyName($this->formArray["companyName"]);
$company->setTin($this->formArray["tin"]);
$company->setTelephone($this->formArray["telephone"]);
$company->setFax($this->formArray["fax"]);
$company->setAddressArray($address);
$company->setEmail($this->formArray["email"]);
$company->setWebsite($this->formArray["website"]);
$company->setDomDocument();
$doc = $company->getDomDocument();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $CompanyEncode->updateCompany($xmlStr))) {
exit("error update");
}
}
}
} else {
$address = new Address();
$address->setNumber($this->formArray["number"]);
$address->setStreet($this->formArray["street"]);
$address->setBarangay($this->formArray["barangay"]);
$address->setDistrict($this->formArray["district"]);
$address->setMunicipalityCity($this->formArray["municipalityCity"]);
$address->setProvince($this->formArray["province"]);
$address->setDomDocument();
$company = new Company();
$company->setCompanyID($this->formArray["companyID"]);
$company->setCompanyName($this->formArray["companyName"]);
$company->setTelephone($this->formArray["telephone"]);
$company->setFax($this->formArray["fax"]);
$company->setTin($this->formArray["tin"]);
$company->setAddressArray($address);
$company->setEmail($this->formArray["email"]);
$company->setWebsite($this->formArray["website"]);
$company->setDomDocument();
$doc = $company->getDomDocument();
$xmlStr = $doc->dump_mem(true);
if (!($ret = $CompanyEncode->saveCompany($xmlStr, $this->formArray["ownerID"]))) {
exit("error save");
//.........这里部分代码省略.........
示例11: testSetStreetWorks
public function testSetStreetWorks()
{
$address = new Address();
$address->setStreet('Rua dos bobos');
$this->assertEquals('Rua dos bobos', $address->getStreet());
}
示例12: Address
}
}
//*
$address = new Address();
//$address->setAddressID(124);
$address->setNumber("xunit 2415 Megaplaza Building");
$address->setStreet("xADB Avenue corner Garnett Street");
$address->setBarangay("xBarangay San Antonio");
$address->setDistrict("xOrtigas Center");
$address->setMunicipalityCity("xPasig City");
$address->setProvince("xMetro Manila");
$address->setDomDocument();
$address1 = new Address();
//$address->setAddressID(124);
$address1->setNumber("unit 2415 Megaplaza Building");
$address1->setStreet("ADB Avenue corner Garnett Street");
$address1->setBarangay("Barangay San Antonio");
$address1->setDistrict("Ortigas Center");
$address1->setMunicipalityCity("Pasig City");
$address1->setProvince("Metro Manila");
$address1->setDomDocument();
$person = new Person();
//$person->setPersonID(126);
$person->setFirstName("Nelson Juan");
$person->setMiddleName("Miranda");
$person->setLastName(date("H:i:s"));
$person->setGender("male");
$person->setBirthday("1977/07/09");
$person->setMaritalStatus("single");
$person->setTin("1234567890");
$person->setTelephone("026584746");
示例13: Main
function Main()
{
switch ($this->formArray["formAction"]) {
case "edit":
$AFSDetails = new SoapObject(NCCBIZ . "AFSDetails.php", "urn:Object");
if (!($xmlStr = $AFSDetails->getAFS($this->formArray["afsID"]))) {
echo "xml failed";
} else {
if (!($domDoc = domxml_open_mem($xmlStr))) {
$this->tpl->set_block("rptsTemplate", "OwnerListTable", "OwnerListTableBlock");
$this->tpl->set_var("OwnerListTableBlock", "error xmlDoc");
} else {
$afs = new AFS();
$afs->parseDomAFS($domDoc);
foreach ($afs as $key => $value) {
$this->formArray[$key] = $value;
}
//print_r($afs);
//exit();
$administrator = $afs->getAdministratorArray();
foreach ($administrator as $key => $value) {
$this->formArray["lastName"] = $value->getLastName();
$this->formArray["firstName"] = $value->getFirstName();
$this->formArray["middleName"] = $value->getMiddleName();
$this->formArray["number"] = $value->getNumber();
$this->formArray["street"] = $value->getStreet();
$this->formArray["barangay"] = $value->getBarangay();
$this->formArray["district"] = $value->getDistrict();
$this->formArray["municipalityCity"] = $value->getMunicipalityCity();
$this->formArray["province"] = $value->getProvince();
$this->formArray["telephone"] = $value->getTelephone();
}
}
}
break;
case "save":
$AFSEncode = new SoapObject(NCCBIZ . "AFSEncode.php", "urn:Object");
if ($this->formArray["afsID"] != "") {
$afs = new AFS();
$afs->selectAFS($this->formArray["afsID"]);
$afs->setOdID($this->formArray["odID"]);
$afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
$afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]);
$afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]);
$afs->setNorth($this->formArray["north"]);
$afs->setSouth($this->formArray["south"]);
$afs->setEast($this->formArray["east"]);
$afs->setWest($this->formArray["west"]);
$afs->setCreatedBy($this->userID);
$afs->setModifiedBy($this->userID);
$person = new Person();
$person->setPersonID($afs->getAdministrator());
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
$person->setMiddleName($this->formArray["middleName"]);
$person->setNumber($this->formArray["number"]);
$person->setStreet($this->formArray["street"]);
$person->setBarangay($this->formArray["barangay"]);
$person->setDistrict($this->formArray["district"]);
$person->setMunicipalityCity($this->formArray["municipalityCity"]);
$person->setProvince($this->formArray["province"]);
$person->setTelephone($this->formArray["telephone"]);
$person->setDom();
$afs->setAdministratorArray($person);
$afs->setDomAFS();
$doc = $afs->getDomAFS();
$xmlStr = $doc->dump_mem();
if (!($ret = $AFSEncode->updateAFS($xmlStr))) {
echo "error update";
}
header("location: AFSClose.php" . $this->sess->url("") . $this->sess->add_query(array("odID" => $ret)));
exit;
} else {
$afs = new AFS();
$afs->setOdID($this->formArray["odID"]);
$afs->setPropertyIndexNumber($this->formArray["propertyIndexNumber"]);
$afs->setCertificateOfTitleNumber($this->formArray["certificateOfTitleNumber"]);
$afs->setCadastralLotNumber($this->formArray["cadastralLotNumber"]);
$afs->setNorth($this->formArray["north"]);
$afs->setSouth($this->formArray["south"]);
$afs->setEast($this->formArray["east"]);
$afs->setWest($this->formArray["west"]);
$afs->setCreatedBy($this->userID);
$afs->setModifiedBy($this->userID);
$adminAddress = new Address();
$adminAddress->setNumber($this->formArray["number"]);
$adminAddress->setStreet($this->formArray["street"]);
$adminAddress->setBarangay($this->formArray["barangay"]);
$adminAddress->setDistrict($this->formArray["district"]);
$adminAddress->setMunicipalityCity($this->formArray["municipalityCity"]);
$adminAddress->setProvince($this->formArray["province"]);
$adminAddress->setDomDocument();
$person = new Person();
$person->setLastName($this->formArray["lastName"]);
$person->setFirstName($this->formArray["firstName"]);
$person->setMiddleName($this->formArray["middleName"]);
$person->setTelephone($this->formArray["telephone"]);
$person->setDomDocument();
$afs->setAdministratorArray($person);
$afs->setDomDocument();
//.........这里部分代码省略.........
示例14: array
if (is_null($address)) {
$response['msg'] = array('desc' => 'Address with id "' . $addressId . '" not found.', 'code' => '404');
} else {
$address->setActive(!$address->isActive());
$entityManager->flush();
$response['address'] = $address->__toJson();
$response['msg'] = array('desc' => 'Address with id "' . $addressId . '" successful updated.', 'code' => '200');
}
/** only if we want add some entry in our database */
} elseif ($request->getMethod() === "POST" && $request->get('action', false) === 'add') {
/** simple add without checks - while not required - only try catch */
try {
$address = new Address();
$address->setForename($request->get('forename'));
$address->setSurname($request->get('surname'));
$address->setStreet($request->get('street'));
$address->setZip($request->get('zip'));
$address->setCity($request->get('city'));
$address->setPhonenumber($request->get('phonenumber'));
$address->setDateofbirth($request->get('date_of_birth') ? new DateTime($request->get('date_of_birth')) : null);
$entityManager->persist($address);
$entityManager->flush();
$response['address'] = $address->__toJson();
$response['msg'] = array('desc' => 'Address with id "' . $address->getId() . '" successful created.', 'code' => '200');
} catch (Exception $e) {
$response['msg'] = array('desc' => $e->getMessage(), 'code' => '500');
}
/** simple get with filtered query */
} else {
/** @var \Doctrine\ORM\QueryBuilder $addressRepository */
$addressRepository = $entityManager->getRepository('Address')->createQueryBuilder('a');
示例15: getAddresses
public static function getAddresses($where = null)
{
$dados = Database::ReadAll("address a, city c, state s", "a.*, c.*, s.*", "WHERE a.id_city = c.id_city AND s.id_state = c.id_state " . $where);
if (!$dados) {
return '';
}
foreach ($dados as $dado) {
$address = new Address();
$address->setId($dado['ID_ADDRESS']);
$address->setStreet($dado['NAME_ADDRESS']);
$address->setNumber($dado['NUMBER']);
$address->setComplement($dado['COMPLEMENT']);
$address->setDistrict($dado['DISTRICT']);
$address->setLatitude($dados['LATITUDE']);
$address->setLongitude($dados['LONGITUDE']);
$address->setCity($dado['NAME_CITY']);
$address->setState($dado['INITIALS']);
$address->setPs($dado['PS']);
$addresses[] = $address;
}
return $addresses;
}