Index.class.php 1.6 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 int $url
     * @param int $text
     * @param int $res
     * @param int $type
     * @param int $sort
     * @param int $id
     * @return boolean
     */
    public static function updateIndex ($url, $text, $res, $type, $sort, $id)
    {
        return self::service()->updateIndex($url, $text, $res, $type, $sort, $id);
    }

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

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