PHP code example of darkling / nette-identity-doctrine
1. Go to this page and download the library: Download darkling/nette-identity-doctrine library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
darkling / nette-identity-doctrine example snippets
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class UserEntity implements IIdentity
{
/** @ORM\Column(type="integer") @ORM\Id @ORM\GeneratedValue */
private $id;
/** @ORM\Column */
private $name;
... other properties, getters & setters
/* implementation of IIdentity */
public function getId()
{
return $this->id;
}
public function getRoles()
{
return [];
}
}