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

update() public method

Update the translation.
public update ( $text, $target, $comments, $catalogue = 'messages' ) : boolean
return boolean true if translation was updated, false otherwise.
    function update($text, $target, $comments, $catalogue = 'messages')
    {
        $details = $this->getCatalogueDetails($catalogue);
        if ($details) {
            list($cat_id, $variant, $count) = $details;
        } else {
            return false;
        }
        $time = time();
        $command = $this->getDBConnection()->createCommand('UPDATE trans_unit SET target = :target, comments = :comments, date_modified = :datemod
					WHERE cat_id = :catid AND source = :source');
        $command->bindParameter(':target', $target, PDO::PARAM_STR);
        $command->bindParameter(':comments', $comments, PDO::PARAM_STR);
        $command->bindParameter(':datemod', $time, PDO::PARAM_INT);
        $command->bindParameter(':catid', $cat_id, PDO::PARAM_INT);
        $command->bindParameter(':source', $text, PDO::PARAM_STR);
        return $command->execute() == 1 ? $this->updateCatalogueTime($cat_id, $variant) : false;
    }