本文整理汇总了PHP中FOS\UserBundle\Entity\User::getProfile方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getProfile方法的具体用法?PHP User::getProfile怎么用?PHP User::getProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FOS\UserBundle\Entity\User
的用法示例。
在下文中一共展示了User::getProfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildForm
public function buildForm(FormBuilderInterface $builder, array $options)
{
/** @var \Wealthbot\RiaBundle\Entity\RiaCompanyInformation $info */
$info = $this->user->getRiaCompanyInformation();
if ($info) {
$name = $info->getName() ? $info->getName() : $this->user->getProfile()->getCompany();
$primaryFirstName = $info->getPrimaryFirstName() ? $info->getPrimaryFirstName() : $this->user->getProfile()->getFirstName();
$primaryLastName = $info->getPrimaryLastName() ? $info->getPrimaryLastName() : $this->user->getProfile()->getLastName();
$contactEmail = $info->getContactEmail() ? $info->getContactEmail() : $this->user->getEmail();
} else {
$name = $this->user->getProfile()->getCompany();
$primaryFirstName = $this->user->getProfile()->getFirstName();
$primaryLastName = $this->user->getProfile()->getLastName();
$contactEmail = $this->user->getEmail();
}
$builder->add('name', 'text', array('data' => $name, 'required' => false))->add('slug', 'text', array('required' => true))->add('primary_first_name', 'text', array('data' => $primaryFirstName, 'required' => false))->add('primary_last_name', 'text', array('data' => $primaryLastName, 'required' => false))->add('website', 'url', array('required' => false))->add('address', 'text', array('required' => false))->add('office', 'text', array('required' => false))->add('city', 'text', array('required' => false))->add('state', 'entity', array('class' => 'WealthbotAdminBundle:State', 'label' => 'State', 'empty_value' => 'Select a State', 'required' => false))->add('zipcode', 'text', array('required' => false))->add('phone_number', 'text', array('required' => false))->add('fax_number', 'text', array('required' => false))->add('contact_email', 'email', array('data' => $contactEmail, 'required' => false));
//Other information
$builder->add('min_asset_size', 'number', array('precision' => 2, 'grouping' => true, 'required' => false))->add('logo_file', 'file', array('required' => false));
//Proposal processing
$builder->add('portfolio_processing', 'choice', array('choices' => RiaCompanyInformation::getPortfolioProcessingChoices(), 'disabled' => true, 'required' => true, 'expanded' => true));
$this->addValidator($builder);
if (!$this->isPreSave) {
$this->addOnBindValidator($builder);
}
}