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);
     }
 }
Пример #2
0
 public function getPasswordRequestedAt()
 {
     if (is_null(parent::getPasswordRequestedAt())) {
     } else {
         return date_format(parent::getPasswordRequestedAt(), 'd-m-Y / H:i:s');
     }
 }
Пример #3
0
 public function __construct()
 {
     parent::__construct();
     $this->isActive = true;
     // may not be needed, see section on salt below
     // $this->salt = md5(uniqid(null, true));
 }
Пример #4
0
 public function __construct()
 {
     parent::__construct();
     $this->setEnabled(true);
     $this->setLocked(false);
     // your own logic
 }
Пример #5
0
 /**
  * Creates a user
  */
 public function __construct()
 {
     parent::__construct();
     $this->lastLocation = new Location();
     $this->lastLocation->setLatitude(0);
     $this->lastLocation->setLongitude(0);
 }
Пример #6
0
 public function __construct()
 {
     $this->packages = new ArrayCollection();
     $this->authors = new ArrayCollection();
     $this->createdAt = new \DateTime();
     parent::__construct();
 }
Пример #7
0
 public function __construct()
 {
     parent::__construct();
     $this->campaigns = new ArrayCollection();
     $this->tasks = new ArrayCollection();
     $this->files = new ArrayCollection();
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     if (empty($this->roles)) {
         $this->roles[] = 'ROLE_USER';
     }
 }
Пример #9
0
 public function __construct()
 {
     parent::__construct();
     $this->created = new \DateTime();
     $this->activated = false;
     $this->enabled = true;
 }
Пример #10
0
 /**
  * Set email and, if there is no username set, set the email as username
  * @param string $email
  * @return $this|\FOS\UserBundle\Model\UserInterface
  */
 public function setEmail($email)
 {
     if (!$this->username) {
         $this->username = $email;
     }
     return parent::setEmail($email);
 }
Пример #11
0
 /**
  * {@inheritdoc}
  */
 public function __toString()
 {
     if (null === $this->getContact()) {
         return parent::__toString();
     }
     return $this->getContact()->__toString();
 }
Пример #12
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->groups = new \Doctrine\Common\Collections\ArrayCollection();
     $this->projects = new \Doctrine\Common\Collections\ArrayCollection();
     $this->tasks = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #13
0
 public function __construct()
 {
     parent::__construct();
     $this->created = new \DateTime();
     $this->lastActivity = new \DateTime();
     $this->image = new \Ben\DoctorsBundle\Entity\image();
     $this->consultations = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #14
0
 public function __construct()
 {
     parent::__construct();
     $this->friendWithMe = new \Doctrine\Common\Collections\ArrayCollection();
     $this->myFriends = new \Doctrine\Common\Collections\ArrayCollection();
     $this->apiKey = substr(str_shuffle('0123456789AZERTYUIOPQSDFGHJKLMWXCVBNazertyuiopqsdfghjklmwxcvbn'), 32);
     $this->roles = array('ROLE_USER');
 }
Пример #15
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
     $this->locked = true;
     $this->applications = new ArrayCollection();
     $this->providers = new ArrayCollection();
 }
Пример #16
0
 public function __construct()
 {
     parent::__construct();
     $this->days = 10;
     $this->alertEmail = false;
     $this->alertDays = 1;
     $this->emailVisible = false;
     $this->homepage = 'Aucune';
 }
 public function __construct()
 {
     parent::__construct();
     $this->email = null;
     // note: when saving the user manager will put the email canonical
     // to empty string hence why we removed the unique constraint,
     // to avoid error being thrown when registering a user only with
     // phone number
     $this->emailCanonical = null;
 }
Пример #18
0
 public function __construct()
 {
     parent::__construct();
     /* @var $doctrine \Doctrine\Bundle\DoctrineBundle\Registry */
     $doctrine = \AppKernel::getStaticContainer()->get('doctrine');
     /* @var $em \Doctrine\ORM\EntityManager */
     $em = $doctrine->getManager();
     $this->setEnabled(true);
     $group = $em->getRepository('ApplicationSonataUserBundle:Group')->find(static::GroupId);
     if ($group) {
         $this->addGroup($group);
     }
 }
Пример #19
0
 /**
  * User constructor.
  */
 public function __construct()
 {
     // Construct parent
     parent::__construct();
     // Set communications as an array
     $this->viewedCommunications = new ArrayCollection();
     // Set default user role
     if (empty($this->roles)) {
         $this->roles = Globals::getDefaultRoles();
     }
     // Set dafault user language
     if (empty($this->language)) {
         $this->language = Globals::getDefaultLanguage();
     }
 }
Пример #20
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
 }
Пример #21
0
 public function __construct()
 {
     parent::__construct();
     // your own logic
 }
Пример #22
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->projects = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #23
0
 public function __construct()
 {
     parent::__construct();
     $this->deals = new \Doctrine\Common\Collections\ArrayCollection();
     $this->address = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #24
0
 public function __construct()
 {
     parent::__construct();
     $this->setRegistered(new \DateTime());
     $this->setUpdated(new \DateTime());
 }
Пример #25
0
 public function __construct()
 {
     parent::__construct();
     $this->language = 'ru';
     $this->exp_total = 0;
     $this->exp_bill = 0;
     $this->userAchievements = new ArrayCollection();
     $this->isSubscribed = true;
     $this->paid_sms = 0;
     $this->paid_dayoffs = 0;
     $this->is_online = false;
     $this->bill = 0;
 }
Пример #26
0
 public function __construct()
 {
     parent::__construct();
     //        $this->guest = new \Doctrine\Common\Collections\ArrayCollection();
     //        $this->company = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #27
0
 public function __construct()
 {
     parent::__construct();
     $this->posts = new ArrayCollection();
 }
Пример #28
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->messages = new \Doctrine\Common\Collections\ArrayCollection();
     $this->subscriptions = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #29
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     $this->courses = new \Doctrine\Common\Collections\ArrayCollection();
     $this->group = new \Doctrine\Common\Collections\ArrayCollection();
 }
Пример #30
0
 /**
  * override original setter, with set username with email.
  *
  * {@inheritDoc}
  *
  * @see \FOS\UserBundle\Model\User::setEmail()
  */
 public function setEmail($email)
 {
     parent::setEmail($email);
     $this->setUsername($email);
     return $this;
 }