public static function deleteByPk($pk, $condition = null, $params = array())
    {
        if (!is_a($condition, '\\mpf\\datasources\\sql\\ModelCondition')) {
            $condition = ModelCondition::getFrom($condition, get_called_class());
        }
        /* @var $condition ModelCondition */
        $condition->compareColumn(static::getDb()->getTablePk(static::getTableName()), $pk);
        return static::deleteAll($condition, $params);
    }
public static function deleteByPk($pk, $condition = null, $params = array())
    {
        if (!is_a($condition, '\\mpf\\datasources\\sql\\ModelCondition')) {
            $condition = ModelCondition::getFrom($condition, get_called_class());
        }
        /* @var $condition ModelCondition */
        $condition->compareColumn(static::getDb()->getTablePk(static::getTableName()), $pk);
        return static::deleteAll($condition, $params);
    }
public static function deleteByPk ( $ pk , $ condition = null , $ params = array ( ) ) { if ( ! is_a ( $ condition , '\\mpf\\datasources\\sql\\ModelCondition' ) ) { $ condition = ModelCondition :: getFrom ( $ condition , get_called_class ( ) ) ; } /* @var $condition ModelCondition */ $ condition -> compareColumn ( static :: getDb ( ) -> getTablePk ( static :: getTableName ( ) ) , $ pk ) ; return static :: deleteAll ( $ condition , $ params ) ; }
Delete models by primary key
@param int|array $pk
@param null|string|ModelCondition $condition
@param array $params
@return int
Delete models by primary key