Newscoop\Entity\User::__construct PHP Method

__construct() public method

public __construct ( string $email = null )
$email string
    public function __construct($email = null)
    {
        $this->email = $email;
        $this->created = $this->updated = new \DateTime();
        $this->groups = new ArrayCollection();
        $this->attributes = new ArrayCollection();
        $this->identities = new ArrayCollection();
        $this->clients = new ArrayCollection();
        $this->role = new Role();
        $this->is_admin = false;
        $this->is_public = false;
        $this->setPassword($this->generateRandomString(6));
        // make sure password is not empty
        $this->points = 0;
    }

Usage Example

Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     $this->groups = new ArrayCollection();
     $this->reader = 'N';
 }