コード例 #1
0
ファイル: File.php プロジェクト: lciolecki/webshot
 /** 
  * @ORM\PrePersist 
  */
 public function preInsert()
 {
     if ($this->fileExists()) {
         $this->setSize(filesize($this->getFullFilePath()));
         $this->setFileMd5(md5_file($this->getFullFilePath()));
         $this->setMimeType(finfo_file(finfo_open(FILEINFO_MIME_TYPE), $this->getFullFilePath()));
     }
     $this->dateCreate = new \Zend_Date();
     $this->hash = \Extlib\Generator::generateDoctrine2($this->getEm(), get_class($this), 'hash', self::HASH_LEN);
 }
コード例 #2
0
ファイル: User.php プロジェクト: lciolecki/webshot
 /**
  * Set password
  *
  * @param string $password
  * @return User
  */
 public function setPassword($password)
 {
     $this->salt = \Extlib\Generator::generateDoctrine2($this->getEm(), get_class($this), 'salt', self::SALT_LEN);
     $this->password = \hash(self::PASSWORD_HASH_ALGORITHM, $password . $this->salt);
     return $this;
 }
コード例 #3
0
ファイル: Webshot.php プロジェクト: lciolecki/webshot
 /** 
  * @ORM\PrePersist 
  */
 public function preInsert()
 {
     $this->dateCreate = new \Zend_Date();
     $this->hash = \Extlib\Generator::generateDoctrine2($this->getEm(), get_class($this), 'hash', self::HASH_LEN);
 }