<?php

/**
 * RokGallery_Model_SliceTagsTable
 * 
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class RokGallery_Model_SliceTagsTable extends RokCommon_Doctrine_Table
{
    /**
     * Returns an instance of this class.
     *
     * @return object RokGallery_Model_SliceTagsTable
     */
    public static function getInstance()
    {
        return Doctrine_Core::getTable('RokGallery_Model_SliceTags');
    }


    /**
     * @param $oldtag
     * @param $newtag
     * @return int|bool
     */
    public static function changeTag($oldtag, $newtag)
    {
        try
        {
            $table = self::getInstance();
            $q = $table->createQuery('st')
                    ->update()
                    ->set('tag','?',$newtag)
                    ->where('tag = ?', $oldtag);
            $ret = $q->execute();
            $q->free();
            return $ret;
        }
        catch(Exception $e)
        {
            throw $e;
        }
    }

}