PHP code example of majkl578 / nette-identity-doctrine

1. Go to this page and download the library: Download majkl578/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/ */

    

majkl578 / 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 array();
	}
}