Index.class.php 1.72 KB
<?php

/**
 *  首页
 *
 * @name Service_Index
 * @version 1.0 (2013-6-5)
 * @package Service/News
 * @since 1.0
 */

class Facade_Index
{
    
    /**
     * 服务
     */
    private static $service = null;
    /**
     *
     * @return Service_Index
     */
    private static function service ()
    {
        if (! isset(self::$service))
        {
            self::$service = new Service_Index();
        }
        return self::$service;
    }
    
    /**
     * 获取首页信息
     * @param $type
     * @return array
     */
    public static function getIndex ($type)
    {
        return self::service()->getIndex($type);
    }

    /**
     * 根据id更新首页信息状态.
     * 用于管理员更新一个首页信息的操作.
     * @param string $url
     * @param string $text
     * @param string $res
     * @param int $type
     * @param int $sort
     * @param string $res_size
     * @param int $id
     * @return boolean
     */
    public static function updateIndex ($url, $text, $res, $type, $sort, $res_size, $id)
    {
        return self::service()->updateIndex($url, $text, $res, $type, $sort, $res_size, $id);
    }

    /**
     * 用户提交首页信息
     * 
     * @param string $url
     * @param string $text
     * @param string $res
     * @param int $type
     * @param int $sort
     * @param string $res_size
     * @return boolean
     */
    public static function submitIndex ($url, $text, $res, $type, $sort, $res_size)
    {
        return self::service()->submitIndex($url, $text, $res, $type, $sort, $res_size);
    }

    /**
     * 删除首页信息
     * @param unknown_type $id
     */
    public static function delIndex($id)
    {
        return self::service()->delIndex($id);
    }
    
}