CRUDlex\Entity::getDefinition PHP Méthode

getDefinition() public méthode

Gets the entity definition.
public getDefinition ( ) : EntityDefinition
Résultat EntityDefinition the definition
    public function getDefinition()
    {
        return $this->definition;
    }

Usage Example

Exemple #1
0
 /**
  * Constructor.
  *
  * @param string $usernameField
  * the username
  *
  * @param string $passwordField
  * the password (hash)
  *
  * @param string $saltField
  * the password hash salt
  *
  * @param Entity $userEntity
  * the actual user data
  *
  * @param array $roles
  * the roles
  */
 public function __construct($usernameField, $passwordField, $saltField, Entity $userEntity, array $roles)
 {
     $this->usernameField = $usernameField;
     $this->passwordField = $passwordField;
     $this->saltField = $saltField;
     // We have to copy it over as symfony/security wants something serializable.
     $this->userData = [];
     foreach ($userEntity->getDefinition()->getFieldNames() as $field) {
         $this->userData[$field] = $userEntity->get($field);
     }
     $this->roles = $roles;
 }
All Usage Examples Of CRUDlex\Entity::getDefinition