<?php
namespace App\Model\Entities\Security;

use Doctrine\ORM\Mapping as ORM;
use Nette\Security\Passwords;

/**
 * @ORM\Entity
 * @ORM\Table(name="user_credentials")
 */
class UserCredentials extends BaseAuthenticationEntity
{
    /** @ORM\Column(type="string", unique=true) */
    protected $email;

    /** @ORM\Column(type="string") */
    protected $passwordHash;

    /**
     * @return mixed
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * @param mixed $email
     */
    public function setEmail($email)
    {
        $this->email = $email;
    }

    /**
     * @return mixed
     */
    public function getPasswordHash()
    {
        return $this->passwordHash;
    }

    /**
     * @param $password
     */
    public function setPassword($password)
    {
        $this->passwordHash = Passwords::hash($password);
    }

}