コード例 #1
0
ファイル: Queue.php プロジェクト: rangulicon/mkvmanager
    /**
     * Adds the operation $operation to the queue
     * @param string $operation
     * @return QueueItem
     */
    public static function add( BackgroundOperation $operation )
    {
        $queueItem = new QueueItem( $operation );

        try {
            $queueItem->store();
        } catch( ezcPersistentObjectAlreadyPersistentException  $e ) {
            // @todo Add status check
            throw new AlreadyQueuedException( $queueItem );
        }

        return $queueItem;
    }