Cml\Model::delByColumn PHP Method

delByColumn() public method

通过主键删除数据-快捷方法
public delByColumn ( mixed $val, string $column = null, string $tableName = null, mixed $tablePrefix = null ) : boolean
$val mixed
$column string 字段名 不传会自动分析表结构获取主键
$tableName string 表名 不传会自动从当前Model中$table属性获取
$tablePrefix mixed 表前缀 不传会自动从当前Model中$tablePrefix属性获取再没有则获取配置中配置的前缀
return boolean
    public function delByColumn($val, $column = null, $tableName = null, $tablePrefix = null)
    {
        is_null($tableName) && ($tableName = $this->getTableName());
        is_null($tablePrefix) && ($tablePrefix = $this->tablePrefix);
        is_null($column) && ($column = $this->db($this->getDbConf())->getPk($tableName, $tablePrefix));
        return $this->db($this->getDbConf())->where($column, $val)->delete($tableName, true, $tablePrefix);
    }