Skip to content
Sven edited this page Mar 28, 2017 · 4 revisions

Annotations

UniqueId

Fills given field with a unique random hash.

Entity

class Entity implements PM\Bundle\ToolBundle\Framework\Interfaces\UniqueIdEntityInterface

/**
 * @var string
 *
 * @ORM\Column(name="field", type="string", length=255)
 *
 * @\PM\Bundle\ToolBundle\Framework\Annotations\UniqueId()
 */
private $field;

Encrypted

Encrypt fields by AES256. Warning: The Listener will load all lazy loaded mappings implementing EncryptedEntityInterface.

config.yml

pm_tool:
    doctrine:
        encryption: '%secret%'

Entity

class Provider implements EncryptedEntityInterface


/**
 * @var string
 *
 * @ORM\Column(name="username", type="string", length=255)
 *
 * @\PM\Bundle\ToolBundle\Framework\Annotations\Encrypted()
 */
private $username;

/**
 * @var bool
 */
private $encrypted;

/**
 * @inheritDoc
 */
public function isEncrypted()
{
    return $this->encrypted;
}

/**
 * @inheritDoc
 */
public function setEncrypted($encrypted)
{
    $this->encrypted = $encrypted;
}
Clone this wiki locally