/** * @param Username $username * * @return bool */ public function hasConsumerWithUsername(Username $username) { $stmt = $this->connection->prepareStatement('SELECT COUNT(*) AS the_count FROM consumer WHERE username = ?'); $stmt->execute(array($username->getValue())); $result = $stmt->fetch(\PDO::FETCH_ASSOC); return (int) $result['the_count'] > 0; }
/** * @param UUID $uuid * @param Username $username * @param Password $password */ public function __construct(UUID $uuid, Username $username, Password $password) { $this->uuid = $uuid->getValue(); $this->username = $username->getValue(); $this->password = $password->getValue(); }