Snap.class.php 1.95 KB
<?php

/**
 *  Snap信息
 *
 * @name Facade_Snap
 * @version 1.0 (2013-6-5)
 * @package Facade/Snap
 * @author hbomb
 * @since 1.0
 */

class Facade_Snap
{

    private static $service = null;
    /**
     * 返回service对象
     *
     * @return Service_Snap_Snap
     */
    public static function service()
    {
        if (null === self::$service)
        {
            self::$service = new Service_Snap();
        }
        return self::$service;
    }
    
    /**
     * 获取snap
     * 
     * @param unknown_type $offset
     * @param unknown_type $limit
     * @param unknown_type $status
     * @return Ambigous <multitype:, Util_Dao_Db_PdoQuery>
     */
    public static function getSnap ($offset, $limit)
    {
        return self::service()->getSnap($offset, $limit);
    }
    
    /**
     * 态获取所有snap个数. 用于前端分页
     * 
     * @param $status
     */
    public static function getSnapTotal ()
    {
        return self::service()->getSnapTotal();
    }
    
    /**
     * 根据id更新明星状态. 用于管理员更新一个明星的操作.
     * @param unknown_type $name
     * @param unknown_type $pics
     * @param unknown_type $description
     * @param unknown_type $state
     * @param unknown_type $brand_id
     * @param unknown_type $seq
     * @param unknown_type $news_ids
     * @param unknown_type $id
     */
    public static function updateSnap ($pic,$text,$create_time,$id)
    {
        $status =  self::service()->updateSnap($pic, $text, $create_time, $id);
        return $status;
    }
    
    /**
     * 用户提交snap. 
     * @param unknown_type $pic
     * @param unknown_type $text
     */
    public static function submitSnap ($pic,$text)
    {
        $status = self::service()->submitSnap($pic, $text);
        return $status;
    }
    
    /**
     * 删除SNAP
     * @param unknown_type $id
     */
    public static function delSnap($id)
    {
        return self::service()->delSnap($id);
    }
}