Imbo\Database\Doctrine::deleteShortUrls PHP Method

deleteShortUrls() public method

public deleteShortUrls ( $user, $imageIdentifier, $shortUrlId = null )
    public function deleteShortUrls($user, $imageIdentifier, $shortUrlId = null)
    {
        $qb = $this->getConnection()->createQueryBuilder();
        $qb->delete($this->tableNames['shorturl'])->where('user = :user')->andWhere('imageIdentifier = :imageIdentifier')->setParameters([':user' => $user, ':imageIdentifier' => $imageIdentifier]);
        if ($shortUrlId) {
            $qb->andWhere('shortUrlId = :shortUrlId')->setParameter(':shortUrlId', $shortUrlId);
        }
        return (bool) $qb->execute();
    }