<?php
/**
 * Created by JetBrains PhpStorm.
 * User: user
 * Date: 15-12-16
 * Time: 下午8:15
 * To change this template use File | Settings | File Templates.
 */
class Service_ShipBatchXml extends Common_Service
{
    /**
     * @var null
     */
    public static $_modelClass = null;

    /**
     * @return Table_Bank|null
     */
    public static function getModelInstance(){
         if (is_null(self::$_modelClass)){
             self::$_modelClass = new Table_ShipBatchXml();
         }
        return self::$_modelClass;
    }

    public static function add($row){
        $model = self::getModelInstance();
        return $model->add($row);
    }

    public static function update($row, $value, $field = "sbx_id"){
        $model = self::getModelInstance();
        return $model->update($row, $value, $field);
    }

    public static function delete($value, $field = "sbx_id"){
        $model = self::getModelInstance();
        return $model->delete($value, $field);
    }

    public static function getByField($value, $field = 'sbx_id', $colums = "*"){
        $model = self::getModelInstance();
        return $model->getByField($value, $field,$colums);
    }

    public static function getAll(){
        $model = self::getModelInstance();
        return $model->getAll();
    }

    public static function getByCondition($condition = array(), $type = '*', $pageSize = 0, $page = 1, $orderBy = ""){
        $model = self::getModelInstance();
        return $model->getByCondition($condition,$type,$pageSize,$page,$orderBy);
    }
}
