public function updateUserToken(UserTokenUpdateStruct $userTokenUpdateStruct)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('id', 'ezuser_accountkey')
        )->from(
            $this->handler->quoteTable('ezuser_accountkey')
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_accountkey'),
                $query->bindValue($userTokenUpdateStruct->userId, null, \PDO::PARAM_INT)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        if (empty($statement->fetchAll(\PDO::FETCH_ASSOC))) {
            $query = $this->handler->createInsertQuery();
            $query
                ->insertInto($this->handler->quoteTable('ezuser_accountkey'))
                ->set(
                    $this->handler->quoteColumn('hash_key'),
                    $query->bindValue($userTokenUpdateStruct->hashKey)
                )->set(
                    $this->handler->quoteColumn('time'),
                    $query->bindValue($userTokenUpdateStruct->time)
                )->set(
                    $this->handler->quoteColumn('user_id'),
                    $query->bindValue($userTokenUpdateStruct->userId)
                );

            $query->prepare()->execute();
        } else {
            $query = $this->handler->createUpdateQuery();
            $query
                ->update($this->handler->quoteTable('ezuser_accountkey'))
                ->set(
                    $this->handler->quoteColumn('hash_key'),
                    $query->bindValue($userTokenUpdateStruct->hashKey)
                )->set(
                    $this->handler->quoteColumn('time'),
                    $query->bindValue($userTokenUpdateStruct->time)
                )->where(
                    $query->expr->eq(
                        $this->handler->quoteColumn('user_id'),
                        $query->bindValue($userTokenUpdateStruct->userId, null, \PDO::PARAM_INT)
                    )
                );
            $query->prepare()->execute();
        }
    }
public function updateUserToken(UserTokenUpdateStruct $userTokenUpdateStruct)
    {
        $query = $this->handler->createSelectQuery();
        $query->select(
            $this->handler->quoteColumn('id', 'ezuser_accountkey')
        )->from(
            $this->handler->quoteTable('ezuser_accountkey')
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('user_id', 'ezuser_accountkey'),
                $query->bindValue($userTokenUpdateStruct->userId, null, \PDO::PARAM_INT)
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        if (empty($statement->fetchAll(\PDO::FETCH_ASSOC))) {
            $query = $this->handler->createInsertQuery();
            $query
                ->insertInto($this->handler->quoteTable('ezuser_accountkey'))
                ->set(
                    $this->handler->quoteColumn('hash_key'),
                    $query->bindValue($userTokenUpdateStruct->hashKey)
                )->set(
                    $this->handler->quoteColumn('time'),
                    $query->bindValue($userTokenUpdateStruct->time)
                )->set(
                    $this->handler->quoteColumn('user_id'),
                    $query->bindValue($userTokenUpdateStruct->userId)
                );

            $query->prepare()->execute();
        } else {
            $query = $this->handler->createUpdateQuery();
            $query
                ->update($this->handler->quoteTable('ezuser_accountkey'))
                ->set(
                    $this->handler->quoteColumn('hash_key'),
                    $query->bindValue($userTokenUpdateStruct->hashKey)
                )->set(
                    $this->handler->quoteColumn('time'),
                    $query->bindValue($userTokenUpdateStruct->time)
                )->where(
                    $query->expr->eq(
                        $this->handler->quoteColumn('user_id'),
                        $query->bindValue($userTokenUpdateStruct->userId, null, \PDO::PARAM_INT)
                    )
                );
            $query->prepare()->execute();
        }
    }
public function updateUserToken ( UserTokenUpdateStruct $ userTokenUpdateStruct ) { $ query = $ this -> handler -> createSelectQuery ( ) ; $ query -> select ( $ this -> handler -> quoteColumn ( 'id' , 'ezuser_accountkey' ) ) -> from ( $ this -> handler -> quoteTable ( 'ezuser_accountkey' ) ) -> where ( $ query -> expr -> eq ( $ this -> handler -> quoteColumn ( 'user_id' , 'ezuser_accountkey' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> userId , null , \ PDO :: PARAM_INT ) ) ) ; $ statement = $ query -> prepare ( ) ; $ statement -> execute ( ) ; if ( empty ( $ statement -> fetchAll ( \ PDO :: FETCH_ASSOC ) ) ) { $ query = $ this -> handler -> createInsertQuery ( ) ; $ query -> insertInto ( $ this -> handler -> quoteTable ( 'ezuser_accountkey' ) ) -> set ( $ this -> handler -> quoteColumn ( 'hash_key' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> hashKey ) ) -> set ( $ this -> handler -> quoteColumn ( 'time' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> time ) ) -> set ( $ this -> handler -> quoteColumn ( 'user_id' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> userId ) ) ; $ query -> prepare ( ) -> execute ( ) ; } else { $ query = $ this -> handler -> createUpdateQuery ( ) ; $ query -> update ( $ this -> handler -> quoteTable ( 'ezuser_accountkey' ) ) -> set ( $ this -> handler -> quoteColumn ( 'hash_key' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> hashKey ) ) -> set ( $ this -> handler -> quoteColumn ( 'time' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> time ) ) -> where ( $ query -> expr -> eq ( $ this -> handler -> quoteColumn ( 'user_id' ) , $ query -> bindValue ( $ userTokenUpdateStruct -> userId , null , \ PDO :: PARAM_INT ) ) ) ; $ query -> prepare ( ) -> execute ( ) ; } }
Update or insert the user token information specified by the user token struct.

@param \eZ\Publish\SPI\Persistence\User\UserTokenUpdateStruct $userTokenUpdateStruct
Update or insert the user token information specified by the user token struct .