本文整理汇总了PHP中sfGuardUser::toArray方法的典型用法代码示例。如果您正苦于以下问题:PHP sfGuardUser::toArray方法的具体用法?PHP sfGuardUser::toArray怎么用?PHP sfGuardUser::toArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfGuardUser
的用法示例。
在下文中一共展示了sfGuardUser::toArray方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['User'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['User'][$this->getPrimaryKey()] = true;
$keys = UserPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getPasswordResetKey(), $keys[2] => $this->getSfGuardUserId(), $keys[3] => $this->getContactId(), $keys[4] => $this->getActive(), $keys[5] => $this->getCreatedAt(), $keys[6] => $this->getUpdatedAt());
if ($includeForeignObjects) {
if (null !== $this->aContact) {
$result['Contact'] = $this->aContact->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->collSessions) {
$result['Sessions'] = $this->collSessions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collSingleSignOnKeys) {
$result['SingleSignOnKeys'] = $this->collSingleSignOnKeys->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collSystemEventSubscriptions) {
$result['SystemEventSubscriptions'] = $this->collSystemEventSubscriptions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collSystemEventInstances) {
$result['SystemEventInstances'] = $this->collSystemEventInstances->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
return $result;
}
示例2: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['sfGuardRememberKey'][serialize($this->getPrimaryKey())])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['sfGuardRememberKey'][serialize($this->getPrimaryKey())] = true;
$keys = sfGuardRememberKeyPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getUserId(), $keys[1] => $this->getRememberKey(), $keys[2] => $this->getIpAddress(), $keys[3] => $this->getCreatedAt());
if ($includeForeignObjects) {
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
}
示例3: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Profile'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['Profile'][$this->getPrimaryKey()] = true;
$keys = ProfilePeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getNickname(), $keys[2] => $this->getEmail(), $keys[3] => $this->getSfGuardUserId());
if ($includeForeignObjects) {
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
}
示例4: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['StatusAction'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['StatusAction'][$this->getPrimaryKey()] = true;
$keys = StatusActionPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getUserId(), $keys[2] => $this->getRepositoryId(), $keys[3] => $this->getBranchId(), $keys[4] => $this->getFileId(), $keys[5] => $this->getMessage(), $keys[6] => $this->getOldStatus(), $keys[7] => $this->getNewStatus(), $keys[8] => $this->getCreatedAt());
if ($includeForeignObjects) {
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aRepository) {
$result['Repository'] = $this->aRepository->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aBranch) {
$result['Branch'] = $this->aBranch->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aFile) {
$result['File'] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
}
示例5: executeRegister
public function executeRegister()
{
$campus = CampusPeer::retrieveByEmail($this->getRequestParameter('register_email'));
$department = DepartmentPeer::retrieveByUuid($this->getRequestParameter('department'));
//$subdepartment = SubdepartmentPeer::retrieveByName('cognitive neuroscience');
if ($campus == null) {
$campus = CampusPeer::retrieveByEmail("@public");
$this->logMessage("Campus was null, now set to ({$campus})");
}
$this->forward404Unless($campus, 'campus not found');
$this->forward404Unless($department, 'department not found');
//$this->forward404Unless($subdepartment, 'subdepartment not found');
$user = new sfGuardUser();
// TODO: Implement form validation in validate.yml
$user->setUsername($this->getRequestParameter('register_email'));
$user->setPassword($this->getRequestParameter('register_password'));
$user->save();
$this->user = $user->toArray();
$this->logMessage('USER_ARRAY: ' . print_r($this->user, true));
$this->username = $this->user['Username'];
$this->logMessage('USER_NAME_VAR: ' . $this->username);
sfPropelApprovableBehavior::disable();
$this->getRequest()->setAttribute('user_id', $user->getId());
$this->logMessage('Set user_id in attributes: [' . $user->getId() . ']:[' . $this->getRequest()->getAttribute('user_id') . ']');
//$temp_email = $this->sendEmail('messages', 'confirmRegistrationEmail');
// Generate a UUID for the user profile, done upon saving it
$profile = $user->getProfile();
$profile->setUserId($user->getId());
$profile->setCampusId($campus->getId());
$profile->setDepartmentId($department->getId());
$profile->setFirstName($this->getRequestParameter('first_name'));
$profile->setLastName($this->getRequestParameter('last_name'));
$profile->setNoPicture();
$profile->setTitle('student');
$profile->setGender(sfConfig::get('app_profile_unknown'));
//$profile->setSubdepartmentId($subdepartment->getId());
$profile->save();
$profile->getPrimaryContactInfo();
$profile->addHistoryEvent($profile->getFullName() . ' has joined the Cothink community.', "We would like to welcome you to Cothink, we know you'll work to make the world a better place!");
$profile->addKarma(sfConfig::get('app_karma_join_site_points'));
// $register_email = $this->sendEmail('messages', 'sendConfirmRegistrationEmail');
sfPropelApprovableBehavior::disable();
$this->user = sfGuardUserPeer::retrieveByUsername('sgrove@berkeley.edu');
/*
$this->logMessage("Sending email confirmation");
$conn = new Swift_Connection_SMTP( sfConfig::get('mod_sfswiftmailer_smtp_host', 'localhost') );
// Need auth for SMTP
$conn->setUsername( sfConfig::get('mod_sfswiftmailer_smtp_user') );
$conn->setPassword( sfConfig::get('mod_sfswiftmailer_smtp_pass') );
$mailer = new Swift($conn);
// Get our message bodies
$htmlBody = $this->getPresentationFor('messages', 'confirmRegistrationHtml');
$textBody = $this->getPresentationFor('messages', 'confirmRegistrationText');
//Create a message
$message = new Swift_Message("Thank you for joining the Cothink community. Please confirm your email address to complete registration.");
//Add some "parts"
$message->attach(new Swift_Message_Part($textBody));
$message->attach(new Swift_Message_Part($htmlBody, "text/html"));
// Send out our mailer
$mailer->send($message, $this->username, 'admin@cothink.dyndns.org');
$mailer->disconnect();
$this->logMessage("Email confirmation sent");
//return sfView:: SUCCESS;
*/
//return $this->redirect('user/pleaseConfirm?user='.urlencode($this->user['Username']));
return $this->redirect("@show_user_profile?user=" . $profile->getUuid());
}
示例6: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Branch'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['Branch'][$this->getPrimaryKey()] = true;
$keys = BranchPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getRepositoryId(), $keys[2] => $this->getName(), $keys[3] => $this->getBaseBranchName(), $keys[4] => $this->getCommitReference(), $keys[5] => $this->getLastCommit(), $keys[6] => $this->getLastCommitDesc(), $keys[7] => $this->getIsBlacklisted(), $keys[8] => $this->getReviewRequest(), $keys[9] => $this->getStatus(), $keys[10] => $this->getCommitStatusChanged(), $keys[11] => $this->getUserStatusChanged(), $keys[12] => $this->getDateStatusChanged(), $keys[13] => $this->getCreatedAt(), $keys[14] => $this->getUpdatedAt());
if ($includeForeignObjects) {
if (null !== $this->aRepository) {
$result['Repository'] = $this->aRepository->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->collComments) {
$result['Comments'] = $this->collComments->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collFiles) {
$result['Files'] = $this->collFiles->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
if (null !== $this->collStatusActions) {
$result['StatusActions'] = $this->collStatusActions->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
}
return $result;
}
示例7: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Comment'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['Comment'][$this->getPrimaryKey()] = true;
$keys = CommentPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getUserId(), $keys[2] => $this->getBranchId(), $keys[3] => $this->getFileId(), $keys[4] => $this->getPosition(), $keys[5] => $this->getLine(), $keys[6] => $this->getType(), $keys[7] => $this->getCommit(), $keys[8] => $this->getValue(), $keys[9] => $this->getRootCommentId(), $keys[10] => $this->getCheckUserId(), $keys[11] => $this->getCheckedAt(), $keys[12] => $this->getCreatedAt(), $keys[13] => $this->getUpdatedAt());
if ($includeForeignObjects) {
if (null !== $this->asfGuardUserRelatedByUserId) {
$result['sfGuardUserRelatedByUserId'] = $this->asfGuardUserRelatedByUserId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aBranch) {
$result['Branch'] = $this->aBranch->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->aFile) {
$result['File'] = $this->aFile->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->asfGuardUserRelatedByCheckUserId) {
$result['sfGuardUserRelatedByCheckUserId'] = $this->asfGuardUserRelatedByCheckUserId->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
}
示例8: toArray
/**
* Exports the object as an array.
*
* You can specify the key type of the array by passing one of the class
* type constants.
*
* @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
* BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
* Defaults to BasePeer::TYPE_PHPNAME.
* @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
* @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
* @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
*
* @return array an associative array containing the field names (as keys) and field values
*/
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Personalcirugia'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['Personalcirugia'][$this->getPrimaryKey()] = true;
$keys = PersonalcirugiaPeer::getFieldNames($keyType);
$result = array($keys[0] => $this->getId(), $keys[1] => $this->getPersonalId(), $keys[2] => $this->getAgendaId(), $keys[3] => $this->getPersonalNombre(), $keys[4] => $this->getTipo(), $keys[5] => $this->getStatus(), $keys[6] => $this->getPrograma(), $keys[7] => $this->getInicia(), $keys[8] => $this->getTransoperatorio(), $keys[9] => $this->getFinaliza(), $keys[10] => $this->getTurno(), $keys[11] => $this->getCreatedAt());
if ($includeForeignObjects) {
if (null !== $this->aAgenda) {
$result['Agenda'] = $this->aAgenda->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
if (null !== $this->asfGuardUser) {
$result['sfGuardUser'] = $this->asfGuardUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
}
}
return $result;
}