public function updateSubAccount(User $user) { $userCurrentPlan = $user->getProfile()->getCurrentPlan(); $plan = $userCurrentPlan->getPlan(); $subaccount_id = $user->getUsername(); $notes = "{$plan->getName()} plan user, signed up on {$userCurrentPlan->getDateStart()->forma('m/d/Y h:i')}"; $custom_quota = $plan->getTotalEmails(); $this->mandrillApi->update->add($subaccount_id, null, $notes, $custom_quota); }
/** * @param User $user * * @return GalaxyUser */ private function userTransformer(User $user) { $username = $user->getUsername(); $attributes = array(); $attributes['mail'] = $user->getEmail(); $attributes['first'] = $user->getFirstname(); $attributes['last'] = $user->getLastname(); $attributes['nationality'] = $user->getSection()->getCountry(); $attributes['picture'] = $user->getGalaxyPicture(); $attributes['birthdate'] = $user->getBirthdate()->format('d/m/Y'); $attributes['gender'] = $user->getGender(); $attributes['telephone'] = $user->getMobile(); $attributes['address'] = $user->getAddress(); $attributes['section'] = $user->getSection()->getCode(); $attributes['country'] = $user->getSection()->getCountry(); $attributes['sc'] = $user->getSection()->getCode(); $attributes['roles'] = explode(',', $user->getGalaxyRoles()); return new GalaxyUser($username, $attributes); }
/** * {@inheritDoc} */ public function getUsername() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getUsername', []); return parent::getUsername(); }
/** * @param User $object Team object * * @return string */ public function toString($object) { return $object instanceof GroupMatch ? 'User ' . $object->getUsername() : 'User'; }
/** * Set author * * @param \UserBundle\Entity\User $author * @return Post */ public function setAuthor(\UserBundle\Entity\User $author = null) { $this->author = $author; if (null !== $author) { $this->setAuthorName($author->getUsername()); $author->addPost($this); } return $this; }
public function uploadFile(UploadedFile $file, User $user, Directory $directory = null) { $directoryPath = $directory ? $directory->getPath() : null; $file->move(self::getUploadRootDir('files/' . $user->getUsername() . $directoryPath), $this->getEncodedName() . '.' . $file->getClientOriginalExtension()); }
/** * @param User $user * * @return UserValueObject */ private function populateUserValueObject(User $user) { return new UserValueObject($user->getId(), $user->getUsername(), $user->getEmail()); }