Prado\I18N\core\MessageSource_Database::delete PHP Method

delete() public method

Delete a particular message from the specified catalogue.
public delete ( $message, $catalogue = 'messages' ) : boolean
return boolean true if deleted, false otherwise.
    function delete($message, $catalogue = 'messages')
    {
        $details = $this->getCatalogueDetails($catalogue);
        if ($details) {
            list($cat_id, $variant, $count) = $details;
        } else {
            return false;
        }
        $command = $this->getDBConnection()->createCommand('DELETE FROM trans_unit WHERE cat_id = :catid AND source = :message');
        $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT);
        $command->bindParameter(':message', $message, PDO::PARAM_STR);
        return $command->execute() == 1 ? $this->updateCatalogueTime($cat_id, $variant) : false;
    }