concrete/src/Permission/IPService.php
public function createRange(RangeInterface $range, $type, DateTime $expiration = null)
    {
        $dateTimeFormat = $this->connection->getDatabasePlatform()->getDateTimeFormatString();
        $this->connection->executeQuery(
            '
                INSERT INTO LoginControlIpRanges
                    (lcirIpFrom, lcirIpTo, lcirType, lcirExpires)
                VALUES
                    (?, ?, ?, ?)
            ',
            [
                $range->getComparableStartString(),
                $range->getComparableEndString(),
                $type,
                ($expiration === null) ? null : $expiration->format($dateTimeFormat),
            ]
        );
        $id = $this->connection->lastInsertId();
        $rs = $this->connection->executeQuery('SELECT * FROM LoginControlIpRanges WHERE lcirID = ? LIMIT 1', [$id]);
        $row = $rs->fetch();
        $rs->closeCursor();

        return IPRange::createFromRow($row, $dateTimeFormat);
    }
public function createRange(RangeInterface $range, $type, DateTime $expiration = null)
    {
        $dateTimeFormat = $this->connection->getDatabasePlatform()->getDateTimeFormatString();
        $this->connection->executeQuery(
            '
                INSERT INTO LoginControlIpRanges
                    (lcirIpFrom, lcirIpTo, lcirType, lcirExpires)
                VALUES
                    (?, ?, ?, ?)
            ',
            [
                $range->getComparableStartString(),
                $range->getComparableEndString(),
                $type,
                ($expiration === null) ? null : $expiration->format($dateTimeFormat),
            ]
        );
        $id = $this->connection->lastInsertId();
        $rs = $this->connection->executeQuery('SELECT * FROM LoginControlIpRanges WHERE lcirID = ? LIMIT 1', [$id]);
        $row = $rs->fetch();
        $rs->closeCursor();

        return IPRange::createFromRow($row, $dateTimeFormat);
    }
public function createRange ( RangeInterface $ range , $ type , DateTime $ expiration = null ) { $ dateTimeFormat = $ this -> connection -> getDatabasePlatform ( ) -> getDateTimeFormatString ( ) ; $ this -> connection -> executeQuery ( '
                INSERT INTO LoginControlIpRanges
                    (lcirIpFrom, lcirIpTo, lcirType, lcirExpires)
                VALUES
                    (?, ?, ?, ?)
            ' , [ $ range -> getComparableStartString ( ) , $ range -> getComparableEndString ( ) , $ type , ( $ expiration === null ) ? null : $ expiration -> format ( $ dateTimeFormat ) , ] ) ; $ id = $ this -> connection -> lastInsertId ( ) ; $ rs = $ this -> connection -> executeQuery ( 'SELECT * FROM LoginControlIpRanges WHERE lcirID = ? LIMIT 1' , [ $ id ] ) ; $ row = $ rs -> fetch ( ) ; $ rs -> closeCursor ( ) ; return IPRange :: createFromRow ( $ row , $ dateTimeFormat ) ; }
Add persist an IP address range type.

@param RangeInterface $range the IP address range to persist
@param int $type The range type (one of the IPService::IPRANGETYPE_... constants)
@param DateTime $expiration The optional expiration of the range type

@return IPRange
Add persist an IP address range type .