Skip to content
Snippets Groups Projects
Select Git revision
  • 1c43bd8c3a409a3ea31f55717aaa0a2c9d2e77ee
  • master default protected
  • b24
  • ll-workflow
  • alc-scindage-donnees-pj
  • FJ_LL_Tbl_Contrat
  • alc-docker-node
  • ll-apiplatform
  • php84
  • ll-rgpd
  • b23
  • alc-filtre-type-intervenant
  • ll-sans-mdb5
  • formules-ancienne-infra
  • ll-formules
  • alc-intervenant-dmep
  • ll-suppr-v_vol-s
  • b20
  • ll-postgresql
  • b23.0.1
  • b22
  • 24.8
  • 24.7
  • 24.6
  • 24.5
  • 24.4
  • 24.3
  • 24.2
  • 24.1
  • 24.0
  • 23.15
  • 24.0-beta19
  • 24.0-beta18
  • 24.0-beta17
  • 24.0-beta16
  • 24.0-beta15
  • 24.0-beta14
  • 24.0-beta13
  • 23.14
  • 24.0-beta12
  • 24.0-beta11
41 results

index.phtml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    User.php 1.88 KiB
    <?php
    
    namespace ZfcUser\Mapper;
    
    use ZfcUser\Entity\UserInterface as UserEntityInterface;
    use Laminas\Hydrator\HydratorInterface;
    
    class User extends AbstractDbMapper implements UserInterface
    {
        protected $tableName  = 'user';
    
        public function findByEmail($email)
        {
            $select = $this->getSelect()
                           ->where(array('email' => $email));
            $entity = $this->select($select)->current();
    
            $this->getEventManager()->trigger('find', $this, array('entity' => $entity));
    
            return $entity;
        }
    
        public function findByUsername($username)
        {
            $select = $this->getSelect()
                           ->where(array('username' => $username));
            $entity = $this->select($select)->current();
    
            $this->getEventManager()->trigger('find', $this, array('entity' => $entity));
    
            return $entity;
        }
    
        public function findById($id)
        {
            $select = $this->getSelect()
                           ->where(array('user_id' => $id));
            $entity = $this->select($select)->current();
    
            $this->getEventManager()->trigger('find', $this, array('entity' => $entity));
    
            return $entity;
        }
    
        public function getTableName()
        {
            return $this->tableName;
        }
    
        public function setTableName($tableName)
        {
            $this->tableName = $tableName;
        }
    
        public function insert(UserEntityInterface $entity, $tableName = null, HydratorInterface $hydrator = null)
        {
            $result = parent::insert($entity, $tableName, $hydrator);
    
            $entity->setId($result->getGeneratedValue());
    
            return $result;
        }
    
        public function update(UserEntityInterface $entity, $where = null, $tableName = null, HydratorInterface $hydrator = null)
        {
            if (!$where) {
                $where = array('user_id' => $entity->getId());
            }
    
            return parent::update($entity, $where, $tableName, $hydrator);