本文整理汇总了PHP中Owner类的典型用法代码示例。如果您正苦于以下问题:PHP Owner类的具体用法?PHP Owner怎么用?PHP Owner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Owner类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayOwnerList
function displayOwnerList($domDoc)
{
$owner = new Owner();
$owner->parseDomDocument($domDoc);
$ownerName = "";
if (count($owner->personArray)) {
foreach ($owner->personArray as $personKey => $personValue) {
if ($ownerName == "") {
$address = $personValue->addressArray[0]->getFullAddress();
$ownerName = $personValue->getName();
} else {
$ownerName = $ownerName . " , " . $personValue->getName();
}
}
} else {
}
if (count($owner->companyArray)) {
foreach ($owner->companyArray as $companyKey => $companyValue) {
if ($ownerName == "") {
$address = $companyValue->addressArray[0]->getFullAddress();
$ownerName = $companyValue->getCompanyName();
} else {
$ownerName = $ownerName . " , " . $companyValue->getCompanyName();
}
}
} else {
}
$this->tpl->set_var("Owner", htmlentities($ownerName));
$this->tpl->set_var("Address", htmlentities($address));
//}
}
示例2: create
public function create()
{
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$username = $_POST['username'];
$password = $_POST['password'];
$gender = $_POST['gender'];
$address = $_POST['address'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$code = $_POST['code'];
$activated = $_POST['activated'];
$owner = new Owner();
$owner->firstname = $firstname;
$owner->lastname = $lastname;
$owner->username = $username;
$owner->password = $password;
$owner->gender = $gender;
$owner->address = $address;
$owner->email = $email;
$owner->phone = $phone;
$owner->code = $code;
$owner->activated = $activated;
if ($owner->save()) {
return $this->viewTpl('owner/show.html', ['owner' => $owner]);
}
}
示例3: postTestAuthorize
public function postTestAuthorize()
{
if (!array_key_exists('X_ALLOW_TEST_AUTH', $_SERVER) || $_SERVER['X_ALLOW_TEST_AUTH'] != 'true') {
return;
}
$data = ['eduPersonPrincipalName' => Input::get('eduPersonPrincipalName'), 'eduPersonScopedAffiliation' => Input::get('eduPersonScopedAffiliation'), 'sn' => Input::get('sn'), 'givenName' => Input::get('givenName'), 'mail' => Input::get('mail')];
$user = (object) $data;
$userId = Input::get('eduPersonPrincipalName');
$owner = Owner::find($userId);
if (!$owner) {
$owner = new Owner();
$owner->id = $userId;
}
$owner->data = json_encode($user);
$owner->save();
$params = Session::get('authorize-params');
$params['user_id'] = $user->eduPersonPrincipalName;
if (Input::get('approve') !== null) {
$code = AuthorizationServer::newAuthorizeRequest('user', $params['user_id'], $params);
Session::forget('authorize-params');
return Redirect::to(AuthorizationServer::makeRedirectWithCode($code, $params));
}
if (Input::get('deny') !== null) {
Session::forget('authorize-params');
$url = AuthorizationServer::makeRedirectWithError($params);
return new \Illuminate\Http\RedirectResponse((string) $url, 302, array());
}
}
示例4: savePerson
function savePerson($xmlStr, $ownerID = "")
{
if (!($domDoc = domxml_open_mem($xmlStr))) {
return false;
}
$person = new Person();
$person->parseDomDocument($domDoc);
$ret = $person->insertRecord();
$owner = new Owner();
$owner->insertOwnerPerson($ownerID, $ret);
return $ret;
}
示例5: displayOwnerList
function displayOwnerList($domDoc)
{
$owner = new Owner();
$owner->parseDomDocument($domDoc);
$ownerPersonName = "";
$address = "";
if (count($owner->personArray)) {
foreach ($owner->personArray as $personKey => $personValue) {
if ($ownerPersonName == "") {
if (is_object($personValue->addressArray[0])) {
$address = $personValue->addressArray[0]->getFullAddress();
$address1 = $personValue->addressArray[0]->getNumber();
$address1 .= " " . $personValue->addressArray[0]->getStreet();
$address1 .= ", " . $personValue->addressArray[0]->getBarangay();
$address2 = $personValue->addressArray[0]->getDistrict();
$address2 .= ", " . $personValue->addressArray[0]->getMunicipalityCity();
$address2 .= ", " . $personValue->addressArray[0]->getProvince();
}
$ownerPersonName = $personValue->getName();
} else {
$ownerPersonName = $ownerName . " , " . $personValue->getName();
}
}
}
$ownerCompanyName = "";
if (count($owner->companyArray)) {
foreach ($owner->companyArray as $companyKey => $companyValue) {
if ($ownerCompanyName == "") {
if ($address == "") {
if (is_object($companyValue->addressArray[0])) {
$address = $companyValue->addressArray[0]->getFullAddress();
$address1 = $companyValue->addressArray[0]->getNumber();
$address1 .= " " . $companyValue->addressArray[0]->getStreet();
$address1 .= ", " . $companyValue->addressArray[0]->getBarangay();
$address2 = $companyValue->addressArray[0]->getDistrict();
$address2 .= ", " . $companyValue->addressArray[0]->getMunicipalityCity();
$address2 .= ", " . $companyValue->addressArray[0]->getProvince();
}
}
$ownerCompanyName = $companyValue->getCompanyName();
} else {
$ownerCompanyName = $ownerCompanyName . " , " . $companyValue->getCompanyName();
}
}
}
$ownerName = $ownerPersonName;
if ($ownerCompanyName != "") {
$ownerName = $ownerPersonName . " , " . $ownerCompanyName;
}
$this->formArray["owner"] = $ownerName;
$this->formArray["ownerAddress1"] = $address1;
$this->formArray["ownerAddress2"] = $address2;
}
示例6: saveCompany
function saveCompany($xmlStr, $ownerID = "")
{
if (!($domDoc = domxml_open_mem($xmlStr))) {
return false;
}
$company = new Company();
$company->parseDomDocument($domDoc);
$ret = $company->insertRecord();
$owner = new Owner();
$owner->insertOwnerCompany($ownerID, $ret);
return $ret;
}
示例7: fromJson
public static function fromJson($json)
{
// Currently, we only support json object
if (is_object($json)) {
$owner = new Owner();
if (isset($json->id)) {
$owner->setId($json->id);
}
if (isset($json->displayName)) {
$owner->setDispalyName($json->displayName);
}
return $owner;
}
return NULL;
}
示例8: displayOwnerList
function displayOwnerList($domDoc)
{
$owner = new Owner();
$owner->parseDomDocument($domDoc);
//$list = $owner->getArrayList();
//foreach ($list as $key => $value){
if (count($owner->personArray)) {
$this->tpl->set_block("rptsTemplate", "PersonDBEmpty", "PersonDBEmptyBlock");
$this->tpl->set_var("PersonDBEmptyBlock", "");
$this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
foreach ($owner->personArray as $personKey => $personValue) {
$this->tpl->set_var("personID", $personValue->getPersonID());
if (!($pname = $personValue->getFullName())) {
$pname = "none";
}
$this->tpl->set_var("fullName", $pname);
$this->tpl->set_var("tin", $personValue->getTin());
$this->tpl->set_var("telephone", $personValue->getTelephone());
$this->tpl->set_var("mobileNumber", $personValue->getMobileNumber());
$this->tpl->parse("PersonListBlock", "PersonList", true);
}
} else {
$this->tpl->set_block("rptsTemplate", "PersonList", "PersonListBlock");
$this->tpl->set_var("PersonListBlock", "");
}
if (count($owner->companyArray)) {
$this->tpl->set_block("rptsTemplate", "CompanyDBEmpty", "CompanyDBEmptyBlock");
$this->tpl->set_var("CompanyDBEmptyBlock", "");
$this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
//print_r($value->companyArray);
foreach ($owner->companyArray as $companyKey => $companyValue) {
$this->tpl->set_var("companyID", $companyValue->getCompanyID());
if (!($cname = $companyValue->getCompanyName())) {
$cname = "none";
}
$this->tpl->set_var("companyName", $cname);
$this->tpl->set_var("tin", $companyValue->getTin());
$this->tpl->set_var("telephone", $companyValue->getTelephone());
$this->tpl->set_var("fax", $companyValue->getFax());
$this->tpl->parse("CompanyListBlock", "CompanyList", true);
}
} else {
$this->tpl->set_block("rptsTemplate", "CompanyList", "CompanyListBlock");
$this->tpl->set_var("CompanyListBlock", "");
}
//}
}
示例9: index
public function index()
{
if (!Owner::isAuthenticated() && !Agent::isAuthenticated()) {
$this->redirect('/');
} else {
$this->view('dashboard/index');
}
}
示例10: create
/**
* Show the form for creating a new resource.
* GET /properties/create
*
* @return Response
*/
public function create()
{
$properties = Owner::where('agent_id', '=', Sentry::getUser()->id)->get();
if (!$properties->isEmpty()) {
return View::make('backend.code.property.create', compact('properties'));
} else {
return Redirect::action('Controllers\\Admin\\UsersController@getCreate')->withFlashMessage('You need to create an Owner first before you Proceed');
}
}
示例11: it_checks_if_owner_is_same_with_given
/** @test */
function it_checks_if_owner_is_same_with_given()
{
$john = Owner::find(1);
$jane = Owner::find(2);
$ownable = $this->getOwnable();
$this->assertFalse($ownable->isOwnedBy($john));
$ownable->associateOwner($john);
$this->assertTrue($ownable->isOwnedBy($john));
$this->assertFalse($ownable->isOwnedBy($jane));
}
示例12: it_changes_owner
/** @test */
public function it_changes_owner()
{
$ownable = $this->getOwnable();
$john = Owner::find(1);
$jane = Owner::find(2);
$this->assertNull($ownable->getOwner());
$ownable->changeOwnerTo($john);
$this->assertEquals($ownable->getOwner(), $john);
$ownable->changeOwnerTo($jane);
$this->assertEquals($ownable->getOwner(), $jane);
}
示例13: run
public function run()
{
Owner::create(array('name' => 'San Jose State University', 'phone_number' => '408-924-1000', 'email_address' => 'admin@sjsu.edu'));
Owner::create(array('name' => 'Public', 'phone_number' => '', 'email_address' => ''));
// Uncomment to use Faker
/*$faker = Faker::create();
for ($i = 0; $i < 10; $i++) {
Owner::create(array(
'name' => $faker->name,
'phone_number' => $faker->phoneNumber,
'email_address' => $faker->email
));
}*/
}
示例14: fromJson
public static function fromJson($json)
{
// Currently, we only support json object
if (is_object($json)) {
$acp = new AccessControlPolicy();
if (isset($json->owner)) {
$acp->setOwner(Owner::fromJson($json->owner));
}
if (isset($json->accessControlList)) {
$acp->setAccessControlList($json->accessControlList);
}
return $acp;
}
return NULL;
}
示例15: fromJson
public static function fromJson($json)
{
// Currently, we only support json object
if (is_object($json)) {
$summary = new FDSObjectSummary();
if (isset($json->name)) {
$summary->setObjectName($json->name);
}
if (isset($json->owner)) {
$summary->setOwner(Owner::fromJson($json->owner));
}
if (isset($json->size)) {
$summary->setSize($json->size);
}
return $summary;
}
return NULL;
}