module/Tag/src/Grid/Tag/Model/Tag/Mapper.php
public function isNameExists( $name, $excludeId = null )
    {
        $platform = $this->getDbAdapter()
                         ->getPlatform();

        $nameEq = new Sql\Predicate\Expression(
            'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
            mb_strtolower( $name, 'UTF-8' )
        );

        return $this->isExists( empty( $excludeId ) ? array(
            $nameEq,
        ) : array(
            $nameEq,
            new Sql\Predicate\Operator(
                'id',
                Sql\Predicate\Operator::OP_NE,
                $excludeId
            ),
        ) );
    }
public function isNameExists( $name, $excludeId = null )
    {
        $platform = $this->getDbAdapter()
                         ->getPlatform();

        $nameEq = new Sql\Predicate\Expression(
            'LOWER(' . $platform->quoteIdentifier( 'name' ) . ') = ?',
            mb_strtolower( $name, 'UTF-8' )
        );

        return $this->isExists( empty( $excludeId ) ? array(
            $nameEq,
        ) : array(
            $nameEq,
            new Sql\Predicate\Operator(
                'id',
                Sql\Predicate\Operator::OP_NE,
                $excludeId
            ),
        ) );
    }
public function isNameExists ( $ name , $ excludeId = null ) { $ platform = $ this -> getDbAdapter ( ) -> getPlatform ( ) ; $ nameEq = new Sql \ Predicate \ Expression ( 'LOWER(' . $ platform -> quoteIdentifier ( 'name' ) . ') = ?' , mb_strtolower ( $ name , 'UTF-8' ) ) ; return $ this -> isExists ( empty ( $ excludeId ) ? array ( $ nameEq , ) : array ( $ nameEq , new Sql \ Predicate \ Operator ( 'id' , Sql \ Predicate \ Operator :: OP_NE , $ excludeId ) , ) ) ; }
Is name already exists

@param   string      $name
@param   int|null    $excludeId
@return  bool
Is name already exists