当前位置: 首页>>代码示例>>PHP>>正文


PHP User::setUpdatedAt方法代码示例

本文整理汇总了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;
 }
开发者ID:nemo-,项目名称:pro-daycare-shop,代码行数:13,代码来源:UserRepository.php

示例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();
 }
开发者ID:SymfonyId,项目名称:Skeleton,代码行数:18,代码来源:LoadUserData.php

示例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);
 }
开发者ID:matheusgontijo,项目名称:MageBrazuca,代码行数:35,代码来源:UserService.php


注:本文中的AppBundle\Entity\User::setUpdatedAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。