ORM::count_null_id_columns PHP Method

count_null_id_columns() public method

Counts the number of columns that belong to the primary key and their value is null.
    public function count_null_id_columns()
    {
        if (is_array($this->_get_id_column_name())) {
            return count(array_filter($this->id(), 'is_null'));
        } else {
            return is_null($this->id()) ? 1 : 0;
        }
    }
ORM