Partner.class.php 1.57 KB
<?php
class Facade_Partner
{
	/**
	 * 服务
	 */
	private static $service = null;

    /**
     * 分类类型
     *
     * @var unknown_type
     */
    public static $types = array
    (
        0 => '特邀合作伙伴',
        1 => '特邀合作媒体',
        2 => '合作伙伴',
    	3 => '合作媒体',
    );
    
	/**
	 *
	 * @return Service_Partner
	 */
	private static function service ()
	{
		if (! isset(self::$service))
		{
			self::$service = new Service_Partner();
		}
		return self::$service;
	}
	
	
	 /**
	  * 获取所有合作伙伴
	  * 
	  * @return array
	  */
	 public static function getPartner()
	 {
	 	 return self::service()->getPartner();
	 }
	 
	 /**
	  * 增加合作伙伴
	  *
	  *	@param int $type 
	  * @param string $name
	  * @param string $pic
	  * @param string $url
	  * @param string $description
	  * @return int
	  */
	 public static function setPartner($type, $name, $pic, $url, $description)
	 {
	 	 return self::service()->setPartner($type, $name, $pic, $url, $description);
	 }
	 
	 /**
	  * 修改合作伙伴
	  * 
	  * @param int $id
	  * @param int $type
	  * @param string $name
	  * @param string $pic
	  * @param string $url
	  * @param string $description
	  * @return boolean
	  */
	 public static function setPartnerById($id, $type, $name, $pic, $url, $description)
	 {
	 	return self::service()->setPartnerById($id, $type, $name, $pic, $url, $description);
	 }
	 
	 /**
	  * 删除合作伙伴
	  * 
	  * @param string $id
	  * @return boolean
	  */
	 public static function delPartner($id)
	 {
	 	return self::service()->delPartner($id);
	 }
}