本文整理汇总了PHP中Person::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Person::getId方法的具体用法?PHP Person::getId怎么用?PHP Person::getId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Person
的用法示例。
在下文中一共展示了Person::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formObject
public function formObject()
{
$model = new Person($this->data->id);
$this->data->forUpdate = $this->data->id != '';
$this->data->object = $model->getData();
$this->data->title = $this->data->forUpdate ? $model->getDescription() : _M("New Person");
$this->data->save = "@fnbr20/auth/person/save/" . $model->getId() . '|formObject';
$this->data->delete = "@fnbr20/auth/person/delete/" . $model->getId() . '|formObject';
$this->render();
}
示例2: executeTwitterCallback
/**
* Create the person or find it.
*/
public function executeTwitterCallback(sfWebRequest $request)
{
$user = $this->getUser();
$this->isAuthenticated = false;
if ($user->isAuthenticated() == true) {
$this->isAuthenticated = true;
$guardUser = $user->getGuardUser();
$guardUserId = $guardUser->getId();
$token = $user->getAttribute('sfTwitterAuth_oauth_access_token');
$secret = $user->getAttribute('sfTwitterAuth_oauth_access_token_secret');
//look for a person with this guard user id already.
$q = Doctrine_Query::create()->from('Person p')->where('p.sf_guard_user_id = ?', $guardUserId);
$person = $q->fetchOne();
$personTable = Doctrine_Core::getTable('Person');
$person = $personTable->findOneBy('sf_guard_user_id', $guardUserId);
$this->addedPerson = false;
$this->personSQLQuery = "GuardUserID={$guardUserId} " . $q->getSqlQuery();
// . "params = " . print_r($q->getParams(), true);
if ($person === false) {
$person = new Person();
$person->setSfGuardUserId($guardUserId);
$person->setTwitterToken($token);
$person->setTwitterSecret($secret);
$person->save();
$this->addedPerson = true;
}
$personId = $person->getId();
$user->setPersonId($personId);
$this->personId = $personId;
$this->redirect('@homepage');
}
}
示例3: SocialSecurity
function testCreate_OneToOne()
{
$this->_createModelAndIncludeThem('social_security', 'SocialSecurity');
$this->_createModelAndIncludeThem('person', 'Person');
$ss = new SocialSecurity();
$ss->setCode($ss_code = 42);
$ss->save();
$person = new Person();
$person->setName($person_name = 'Vasya');
$person->setSocialSecurity($ss);
$person->save();
$loaded_ss = lmbActiveRecord::findById('SocialSecurity', $ss->getId());
$this->assertEqual($loaded_ss->getCode(), $ss_code);
$this->assertEqual($loaded_ss->getPerson()->getId(), $person->getId());
$loaded_person = lmbActiveRecord::findById('Person', $person->getId());
$this->assertEqual($loaded_person->getSocialSecurity()->getId(), $ss->getId());
}
示例4: id
public function id()
{
if ($this->exists("LOGIN-id")) {
return $this->getVariable("LOGIN-id");
} else {
$id = parent::getId();
$this->addVariable("LOGIN-id", $id);
return $id;
}
}
示例5: shouldBeAbleToCreateAndGetObjects
/**
* @test
*/
public function shouldBeAbleToCreateAndGetObjects()
{
// given
$person = new Person();
$person->setFirstname('Alf');
$person->commit();
// when
$p = new Person($person->getId());
// then
$this->assertEquals('Alf', $p->getFirstname());
}
示例6: findChildAndParentsRelationshipTo
/**
* Find the relationships in which the given person is a child
*
* @param Gedcomx\Conclusion\Person\Person $child
*
* @return Gedcomx\Extensions\FamilySearch\Platform\Tree\ChildAndParentsRelationship|null
*/
public function findChildAndParentsRelationshipTo(Person $child)
{
$relationships = $this->getChildAndParentsRelationships();
if ($relationships != null) {
foreach ($relationships as $relation) {
$personReference = $relation->getChild();
if ($personReference != null) {
$reference = $personReference->getResource();
if ($reference == "#" . $child->getId()) {
return $relation;
}
}
}
}
return null;
}
示例7: __construct
//.........这里部分代码省略.........
if ($introducee1->getLinkedInId() != null || $introducee2->getLinkedInId() != null) {
// Connect to LinkedIn API
$sth = $db->prepare('SELECT id, access_token FROM linkedin WHERE person_id = :person_id');
$sth->execute(array(':person_id' => $userId));
$userDetails = $sth->fetch(PDO::FETCH_ASSOC);
if (!empty($userDetails['access_token'])) {
$linkedInAccessToken = $userDetails['access_token'];
// Create LinkedIn object
$API_CONFIG = array('appKey' => LI_API_KEY, 'appSecret' => LI_SECRET, 'callbackUrl' => '');
$OBJ_linkedin = new LinkedIn($API_CONFIG);
$OBJ_linkedin->setTokenAccess(unserialize($linkedInAccessToken));
// Which introducees are on LinkedIn?
$profilesToRequest = array();
if ($introducee1->getLinkedInId() != null) {
$profilesToRequest[] = 'id=' . $introducee1->getLinkedInId();
}
if ($introducee2->getLinkedInId() != null) {
$profilesToRequest[] = 'id=' . $introducee2->getLinkedInId();
}
try {
$linkedInProfiles = $OBJ_linkedin->profileNew('::(' . implode(',', $profilesToRequest) . '):(id,public-profile-url,picture-url)');
} catch (ErrorException $e) {
}
if ($linkedInProfiles['success'] === TRUE) {
$linkedInProfiles['linkedin'] = new SimpleXMLElement($linkedInProfiles['linkedin']);
if ($linkedInProfiles['linkedin']->getName() == 'people') {
foreach ($linkedInProfiles['linkedin']->person as $person) {
$id = (string) $person->id;
$url = (string) $person->{'public-profile-url'};
$pic = (string) $person->{'picture-url'};
if ($id && ($url || $pic)) {
$update = $db->prepare('REPLACE INTO temp_linkedin SET linkedin_id = :linkedin_id, time=NOW(), profile_url = :profile_url, picture_url = :picture_url');
$update->execute(array(':linkedin_id' => $id, ':profile_url' => $url, ':picture_url' => $pic));
}
}
}
}
}
}
// If the introducees are on Twitter, add their screen name and picture to the DB
if ($introducee1->getTwitterId() != null || $introducee2->getTwitterId() != null) {
// Which introducees are on Twitter?
$profilesToRequest = array();
if ($introducee1->getTwitterId() != null) {
$profilesToRequest[] = $introducee1->getTwitterId();
}
if ($introducee2->getTwitterId() != null) {
$profilesToRequest[] = $introducee2->getTwitterId();
}
// Connect to Twitter API
$sth = $db->prepare('SELECT id, access_token FROM twitter WHERE person_id = :person_id');
$sth->execute(array(':person_id' => $userId));
$userDetails = $sth->fetch(PDO::FETCH_ASSOC);
if (!empty($userDetails['access_token'])) {
$twitterAccessToken = unserialize($userDetails['access_token']);
try {
$twitter = new TwitterOAuth(TW_CONSUMER, TW_SECRET, $twitterAccessToken['oauth_token'], $twitterAccessToken['oauth_token_secret']);
$twitter->format = 'json';
$twitterProfiles = $twitter->get('users/lookup', array('user_id' => implode(',', $profilesToRequest)));
foreach ($twitterProfiles as $friend) {
$id = (string) $friend->id;
$screenName = (string) $friend->screen_name;
$pic = (string) $friend->profile_image_url;
$protected = (string) $friend->protected;
if ($id && ($screenName || $pic || $protected)) {
$update = $db->prepare('REPLACE INTO temp_twitter SET twitter_id = :twitter_id, time=NOW(), screen_name = :screen_name, picture_url = :picture_url, protected = :protected');
$update->execute(array(':twitter_id' => $id, ':screen_name' => $screenName, ':picture_url' => $pic, ':protected' => $protected));
}
}
} catch (ErrorException $e) {
// Could not post to Twitter. Bad access token?
Debug::l('Error posting to Twitter ' . $e);
}
}
}
$linkPassword = BaseConvert::generatePassword();
// Add the introduction to the database
$insert = $db->prepare('INSERT INTO introduction (introducer_id, introducee1_id, introducee2_id, time, link_password) VALUES (:introducer_id, :introducee1_id, :introducee2_id, NOW(), :link_password)');
$insert->execute(array(':introducer_id' => $userId, ':introducee1_id' => $introducee1->getId(), ':introducee2_id' => $introducee2->getId(), ':link_password' => $linkPassword));
$introId = $db->lastInsertId();
// Add the links for each introducee
$linkPassword1 = BaseConvert::generatePassword();
$linkPassword2 = BaseConvert::generatePassword();
$insert = $db->prepare('INSERT INTO link (introduction_id, person_id, link_password) VALUES (:introduction_id, :person_id, :link_password)');
$insert->execute(array(':introduction_id' => $introId, ':person_id' => $introducee1->getId(), ':link_password' => $linkPassword1));
$insert->execute(array(':introduction_id' => $introId, ':person_id' => $introducee2->getId(), ':link_password' => $linkPassword2));
// If there is a message, add it to the database
if (!empty($_POST["message"])) {
$message = htmlentities(trim($_POST['message']), ENT_QUOTES, 'UTF-8');
if (!empty($message)) {
$insert = $db->prepare('INSERT INTO message (body, time, introduction_id, writer_id) VALUES (:body, NOW(), :introduction_id, :writer_id)');
$insert->execute(array(':body' => $message, ':introduction_id' => $introId, ':writer_id' => $userId));
}
}
// Return the success message, which will tell the Javascript to redirect the user to the send-introduction page
$json['result'] = 'true';
$json['link'] = APP_URL . '/' . Content::l() . '/send-introduction/';
$json['time'] = Debug::getInstance()->getTimeElapsed();
echo json_encode($json);
}
示例8: Department
try {
$d = new Department($row['department']['name']);
$person->setDepartment($d);
} catch (Exception $e) {
// We may have deleted a department that person was a member of
// The person will just not get put in a department
}
}
if (!empty($row['phone']['number'])) {
$person->setPhoneNumber($row['phone']['number']);
}
if (!empty($row['phone']['device_id'])) {
$person->setPhoneDeviceId($row['phone']['device_id']);
}
$person->save();
$zend_db->insert('people_crosswalk', array('person_id' => $person->getId(), 'mongo_id' => (string) $row['_id']));
echo "Person: {$person->getFullname()}\n";
}
// Load the Categories
$result = $mongo->categories->find();
foreach ($result as $r) {
$c = new Category();
$c->setName($r['name']);
$c->setDescription($r['description']);
$c->setDisplayPermissionLevel($r['displayPermissionLevel']);
$c->setPostingPermissionLevel($r['postingPermissionLevel']);
$g = new CategoryGroup($r['group']['name']);
$c->setCategoryGroup($g);
$d = new Department($r['department']['name']);
$c->setDepartment($d);
if (!empty($r['customFields'])) {
示例9: printAllEmployees
<?php
function printAllEmployees($employees)
{
foreach ($employees as $employee) {
echo "Id : " . $employee->id . "\n" . "Name : " . $employee->name . "\n";
}
}
include_once "Entities\\Person.php";
include_once "Entities\\Employee.php";
include_once "Entities\\Manager.php";
include_once "Entities\\Department.php";
$ivan = new Person("vano", 111);
// $ivan -> id = 111123;
// $ivan -> name = "vano";
echo $ivan->getName() . "\n";
echo $ivan->getId() . "\n";
echo $ivan->__get("name") . "\n";
echo $ivan->__get("id") . "\n";
$ivanSalary = $ivan->__get("salary") . "\n";
$ivanAge = $ivan->age . "\n";
// неявно вызывает функцию __get
echo "ivan has salary :" . $ivanSalary;
echo "ivan has age :" . $ivanAge;
$he = new Employee();
$hisResult = $he->work(true);
echo "Он работал весь день и результат: " . $hisResult . "\n";
$she = new Manager(10000000);
$herSalary = $she->salary;
echo "Она не работала весь день и ее зарплата: " . $herSalary . "\n";
$employees = array();
$department = new Department("IT", $employees, $she);
示例10: executeUpdateAjaxCompanion
public function executeUpdateAjaxCompanion(sfWebRequest $request)
{
#security
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
# id parameter is companion id which then edits
if ($request->hasParameter('id')) {
$cmp = CompanionPeer::retrieveByPK($request->getParameter('id'));
$this->forward404Unless($cmp);
} else {
#new companion adding to existing passenger
$cmpnnPid = $request->getParameter('campnn[passenger_id]');
$cmp = new Companion();
if (isset($cmpnnPid)) {
$cmp->setPassengerId($cmpnnPid);
} else {
$cmp->setPassengerId($request->getParameter('passenger_id'));
}
}
$this->itId = $request->getParameter('itId');
#referer
if ($request->hasParameter('referer')) {
$this->referer = $request->getParameter('referer');
} else {
$this->referer = $request->getReferer() ? $request->getReferer() : $this->generateUrl('companion', array(), true);
}
$form = new CompanionForm($cmp);
if ($request->getParameter('back')) {
$this->back = $request->getParameter('back');
}
# validate and save
if ($request->isMethod('post')) {
$form->bind($request->getParameter($form->getName()));
if ($form->isValid()) {
$is_new = $form->isNew();
if ($is_new) {
$person = new Person();
$names = explode(" ", $form->getValue('name'));
$person->setFirstName($names[0]);
if (isset($names[1])) {
$person->setLastName($names[1]);
} else {
$person->setLastName(NULL);
}
$person->setDayPhone($form->getValue('companion_phone'));
$person->setDayComment($form->getValue('companion_phone_comment'));
$person->save();
$comp = $form->getObject();
$comp->setName($form->getValue('name'));
$comp->setRelationship($form->getValue('relationship'));
$comp->setDateOfBirth($form->getValue('date_of_birth'));
$comp->setWeight($form->getValue('weight'));
$comp->setCompanionPhone($form->getValue('companion_phone'));
$comp->setCompanionPhoneComment($form->getValue('companion_phone_comment'));
$comp->setPersonId($person->getId());
$comp->save();
} else {
$form->save();
}
$this->getUser()->setFlash('success', 'Companion has successfully ' . ($is_new ? 'created' : 'saved') . '!');
$this->companion_saved = $form->getValue('name');
$this->companion_id = $comp->getId();
$this->relationship = $form->getValue('relationship');
}
}
$passenger = $cmp->getPassenger();
$this->forward404Unless($passenger);
$this->passenger = $passenger;
$this->form_a = $form;
$this->cmp = $cmp;
}
示例11: executeAjaxCreate
public function executeAjaxCreate(sfWebRequest $request)
{
if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Coordinator'), false)) {
$this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer());
$this->redirect('dashboard/index');
}
$this->form = new CompanionForm();
$this->form->bind($request->getParameter($this->form->getName()));
if ($this->form->isValid()) {
//----------------------------------------------
$person = new Person();
$names[] = split(" ", $this->form->getValue('name'));
//echo var_dump($names); die();
$person->setFirstName($names[0][0]);
$person->setLastName($names[0][1]);
$person->setDayPhone($this->form->getValue('companion_phone'));
$person->setDayComment($this->form->getValue('companion_phone_comment'));
$person->save();
$comp = $this->form->getObject();
$comp->setPassengerId($this->form->getValue('passenger_id'));
$comp->setName($this->form->getValue('name'));
$comp->setRelationship($this->form->getValue('relationship'));
$comp->setDateOfBirth($this->form->getValue('date_of_birth'));
$comp->setWeight($this->form->getValue('weight'));
$comp->setCompanionPhone($this->form->getValue('companion_phone'));
$comp->setCompanionPhoneComment($this->form->getValue('companion_phone_comment'));
$comp->setPersonId($person->getId());
$comp->save();
//----------------------------------------------
//$companion = $this->form->save();
$id = $comp->getId();
$name = addslashes($comp->getName());
$rel = addslashes($comp->getRelationship());
return $this->renderText("<script type=\"text/javascript\">appendCompanion({$id},'{$name}','{$rel}')</script>");
} else {
$this->setTemplate('ajaxNew');
$this->el_id = $request->getParameter('el_id');
}
}
示例12: signIn
/**
* Signs the user in
* @param Person $person
* @param sfWebRequest $request
*/
private function signIn(Person $person, sfWebRequest $request)
{
$cur_user = $this->getUser();
$cur_user->setAttribute('id', $person->getId(), 'person');
$cur_user->setAttribute('username', $person->getUsername(), 'person');
$cur_user->setAttribute('firstname', $person->getFirstName(), 'person');
$cur_user->setAttribute('lastname', $person->getLastName(), 'person');
# set member and pilot ids
$members = $person->getMembers();
if (isset($members[0])) {
$cur_user->setAttribute('member_id', $members[0]->getId(), 'person');
$pilot = $members[0]->getPilot();
if ($pilot) {
$cur_user->setAttribute('pilot_id', $pilot->getId(), 'person');
}
}
/* Custom Code - Ziyed and Aftab */
$cur_user_roles = array();
$query = "select role_id from afids.person_role where person_role.person_id ='" . $person->getId() . "'";
$conn = Propel::getConnection();
$statement = $conn->prepare($query);
$statement->execute();
while ($row = $statement->fetch()) {
$cur_user_roles[] = $row['role_id'];
}
///////Ziyed do credential//////
$warnings = array();
if (array_intersect($cur_user_roles, array(1, 2, 26))) {
$cur_user->addCredential('Administrator');
} elseif (array_intersect($cur_user_roles, array(3, 4, 28))) {
$cur_user->addCredential('Staff');
} elseif (array_intersect($cur_user_roles, array(7, 24, 25, 29))) {
$cur_user->addCredential('Coordinator');
} else {
if (array_intersect($cur_user_roles, array(31, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23))) {
if (isset($members[0]) && $members[0] instanceof Member) {
$cur_user->addCredential('Member');
} else {
$warnings[] = 'You are a member but you don\'t have proper database record';
}
} elseif (array_intersect($cur_user_roles, array(30))) {
$cur_user->addCredential('Volunteer');
} elseif (array_intersect($cur_user_roles, array(5, 6, 27))) {
if (isset($pilot) && $pilot instanceof Pilot) {
$cur_user->addCredential('Pilot');
} else {
$warnings[] = 'You are a pilot but you don\'t have proper database record';
}
} else {
$warnings[] = 'you don\'t have proper database record';
if (count($warnings)) {
$this->getUser()->setFlash('warning', implode(". ", $warnings));
}
$this->redirect('/');
}
}
//////Ziyed end
$cur_user->setAuthenticated(true);
/* End of Custom Code - Ziyed and Aftab */
# add credentials
/*
$warnings = array();
$person_roles = $person->getPersonRolesJoinRole();
foreach ($person_roles as $person_role) {
$credential = $person_role->getRole()->getTitle();
//if ($credential == '@Pilot'){
if ($credential == 'Pilot'){
// @Pilot role can be assigned only if current user has Pilot record set
if (isset($pilot) && ($pilot instanceof Pilot)) {
$cur_user->addCredential($credential);
}else{
$warnings[] = 'You are a pilot but you don\'t have proper database record';
}
}elseif ($credential == 'Member'){
// @Member role can be assigned only if current user has Member record set
if (isset($members[0]) && ($members[0] instanceof Member)) {
$cur_user->addCredential($credential);
}else{
$warnings[] = 'You are a member but you don\'t have proper database record';
}
}else{
$cur_user->addCredential($credential);
}
}*/
if (count($warnings)) {
$this->getUser()->setFlash('warning', implode(". ", $warnings));
}
}
示例13: assertPreConditions
/**
* {@inheritdoc}
*/
protected function assertPreConditions()
{
$this->assertInstanceOf('JLM\\ContactBundle\\Model\\CompanyInterface', $this->entity);
$this->assertNull($this->entity->getId());
$this->assertCount(0, $this->entity->getContacts());
}
示例14: processStep3Check
protected function processStep3Check(sfWebRequest $request)
{
$default_airport = AirportPeer::getByIdent(sfConfig::get('app_default_airport_ident'));
$this->forward404Unless($default_airport);
$app = $this->application_temp;
$person = $this->person;
if (!$person instanceof Person) {
$person = new Person();
}
/* @var $app ApplicationTemp */
/* @var $person Person */
// Person
$tmp_arr = $app->toArray(BasePeer::TYPE_FIELDNAME);
$tmp_arr['evening_phone'] = $tmp_arr['eve_phone'];
$tmp_arr['evening_comment'] = $tmp_arr['eve_comment'];
unset($tmp_arr['id']);
$person->fromArray($tmp_arr, BasePeer::TYPE_FIELDNAME);
$person->save();
// Member
$member = MemberPeer::getByPersonId($person->getId());
if (!$member instanceof Member) {
$member = new Member();
}
// Generate external id using last member is and external id
$c = new Criteria();
$c->add(MemberPeer::EXTERNAL_ID, NULL, Criteria::ISNOTNULL);
$c->addDescendingOrderByColumn(MemberPeer::ID);
$external_member = MemberPeer::doSelectOne($c);
$external_id = $external_member->getExternalId();
$currentExternalId = $external_id + 1;
//print_r($external_id);
//print_r($currentExternalId);
$member->setActive(1);
$member->setCoPilot($app->getApplicantCopilot());
$member->setContact('By Email');
$member->setDateOfBirth($app->getDateOfBirth());
$member->setDriversLicenseState($app->getDriversLicenseState());
$member->setDriversLicenseNumber($app->getDriversLicenseNumber());
$member->setEmergencyContactName($app->getEmergencyContactName());
$member->setEmergencyContactPhone($app->getEmergencyContactPhone());
$member->setFlightStatus($app->getApplicantPilot() ? 'Verify Orientation' : 'Non-pilot');
$member->setJoinDate(time());
$member->setLanguages($app->getLanguagesSpoken());
//$member->setMasterMemberId($app->getMasterMemberId());
$member->setMemberClassId($app->getMemberClassId());
$member->setPersonId($person->getId());
$member->setRenewedDate(time());
$member->setRenewalDate(strtotime('+1 year'));
$member->setSpouseName($app->getSpouseFirstName() . ' ' . $app->getSpouseLastName());
//external_id generate
$member->setExternalId($currentExternalId);
$member->setWingId($app->getWingId());
$member->save();
// Pilot
if ($app->getApplicantPilot()) {
$pilot = new Pilot();
$pilot->setMemberId($member->getId());
$airport = AirportPeer::getByIdent($app->getHomeBase());
if (!$airport instanceof Airport) {
$airport = $default_airport;
}
$pilot->setPrimaryAirportId($airport->getId());
$pilot->setTotalHours($app->getTotalHours());
$pilot->setLicenseType('Private');
foreach (sfConfig::get('app_pilot_license_types') as $key => $val) {
if (stripos($app->getRatings(), $key) !== false) {
$pilot->setLicenseType($key);
}
}
$pilot->setIfr(stripos($app->getRatings(), 'ifr') !== false ? 1 : 0);
$pilot->setMultiEngine(stripos($app->getRatings(), 'multi') !== false ? 1 : 0);
$pilot->setSeInstructor('No');
// @see ApplicationForm
foreach (sfConfig::get('app_pilot_se_instructor') as $key => $val) {
if (stripos($app->getRatings(), $key) !== false) {
$pilot->setSeInstructor($key);
}
}
$pilot->setMeInstructor($pilot->getSeInstructor());
$pilot->save();
// Availability
$availability = new Availability();
$availability->setMemberId($member->getId());
$availability->setNotAvailable(0);
$availability->setNoWeekday($app->getAvailabilityWeekdays() == 0);
$availability->setNoNight($app->getAvailabilityWeeknights() == 0);
$availability->setLastMinute($app->getAvailabilityLastMinute());
$availability->setAsMissionMssistant($app->getAvailabilityCopilot());
$availability->setNoWeekend($app->getAvailabilityWeekends() == 0);
try {
$availability->save();
} catch (Exception $e) {
}
// Primary aircraft
if ($app->getAircraftPrimaryId() && ($aircraft = AircraftPeer::retrieveByPK($app->getAircraftPrimaryId()))) {
$pilot_aircraft = new PilotAircraft();
$pilot_aircraft->setMemberId($member->getId());
$pilot_aircraft->setAircraftId($aircraft->getId());
$pilot_aircraft->setNNumber($app->getAircraftPrimaryNNumber());
$pilot_aircraft->setOwn($app->getAircraftPrimaryOwn());
//.........这里部分代码省略.........
示例15: getPersonWithPhone
private function getPersonWithPhone($firstname = '', $phoneNumbers = array())
{
$person = new Person();
$person->setFirstname($firstname);
$this->createCity();
$person->setZip(4330);
$person->commit();
$id = $person->getId();
foreach ($phoneNumbers as $number) {
$this->addPhone($id, $number);
}
return new Person($id);
}