本文整理汇总了PHP中AppBundle\Entity\User::setUpdatedAt方法的典型用法代码示例。如果您正苦于以下问题:PHP User::setUpdatedAt方法的具体用法?PHP User::setUpdatedAt怎么用?PHP User::setUpdatedAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppBundle\Entity\User
的用法示例。
在下文中一共展示了User::setUpdatedAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* @param User $user
*
* @return User
*/
public function save(User $user)
{
$updatedAt = new \DateTime();
$user->setUpdatedAt($updatedAt);
$this->_em->persist($user);
$this->_em->flush();
return $user;
}
示例2: load
public function load(ObjectManager $manager)
{
$userPassword = 'siab';
$date = new \DateTime();
$user = new User();
$user->setUsername($userPassword);
$user->setEmail('admin@mail.com');
$user->setFullName('super administrator');
$user->setRoles(array('ROLE_SUPER_ADMIN'));
$user->setPlainPassword($userPassword);
$user->setEnabled(true);
$user->setCreatedAt($date);
$user->setUpdatedAt($date);
$user->setCreatedBy('SYSTEM');
$user->setUpdatedBy('SYSTEM');
$manager->persist($user);
$manager->flush();
}
示例3: update
public function update(User $user, $firstname, $lastname, $email, $username, $password, $about, $picture, $location, $locationCityShort, $locationCityLong, $locationStateShort, $locationStateLong, $locationCountryShort, $locationCountryLong, $gender, $company, $isAvailableToHiring, $contactWebsite, $contactTwitter, $contactLinkedIn, $contactCertification, $contactGitHub, $contactStackOverflow)
{
if ($errors = $this->getErrors($firstname, $lastname, $email, $username, $password, $about, $locationCityShort, $locationCityLong, $locationStateShort, $locationStateLong, $locationCountryShort, $locationCountryLong, $gender, $company, $isAvailableToHiring, true, $password == '' ? false : true)) {
throw new ServiceException($errors);
}
$user->setUsername($username);
$user->setFirstname($firstname);
$user->setLastname($lastname);
$user->setEmail($email);
$user->setAbout($about);
$user->setLocation($location);
$user->setLocationCityShort($locationCityShort);
$user->setLocationCityLong($locationCityLong);
$user->setLocationStateShort($locationStateShort);
$user->setLocationStateLong($locationStateLong);
$user->setLocationCountryShort($locationCountryShort);
$user->setLocationCountryLong($locationCountryLong);
$user->setGender($gender);
$user->setCompany($company);
$user->setIsAvailableToHiring($isAvailableToHiring);
$user->setContactWebsite($contactWebsite);
$user->setContactTwitter($contactTwitter);
$user->setContactLinkedIn($contactLinkedIn);
$user->setContactCertification($contactCertification);
$user->setContactGitHub($contactGitHub);
$user->setContactStackOverflow($contactStackOverflow);
$user->setUpdatedAt(new \DateTime());
if ($picture) {
$user->setPicturePath($this->moveImageFromTmpToFolder($picture));
}
if ($password) {
$user->setPassword(md5($password));
}
return $this->repository->create($user);
}