public function getAllColumns($includeParent = true)
    {
        // build a list of columns for this model
        $metaData = $this->getDI()->get('memory');
        $colMap = $metaData->getColumnMap($this);
        if (is_null($colMap)) {
            // but if it isn't present, fall back to attributes
            $colMap = $metaData->getAttributes($this);
        }

        if ($includeParent) {
            $parentModel = $this->getParentModel(true);
            if ($parentModel) {
                /** @var BaseModel $parentModel */
                $parentModel = new $parentModel();
                $parentColumns = $parentModel->getAllColumns(true);

                // the parent model may return null, let's catch and change to an empty array
                // thus indicating that block columns have been "loaded" even if they are blank
                if ($parentColumns == null) {
                    $parentColumns = [];
                }
                $colMap = array_merge($colMap, $parentColumns);
            }
        }
        return $colMap;
    }
public function getAllColumns($includeParent = true)
    {
        // build a list of columns for this model
        $metaData = $this->getDI()->get('memory');
        $colMap = $metaData->getColumnMap($this);
        if (is_null($colMap)) {
            // but if it isn't present, fall back to attributes
            $colMap = $metaData->getAttributes($this);
        }

        if ($includeParent) {
            $parentModel = $this->getParentModel(true);
            if ($parentModel) {
                /** @var BaseModel $parentModel */
                $parentModel = new $parentModel();
                $parentColumns = $parentModel->getAllColumns(true);

                // the parent model may return null, let's catch and change to an empty array
                // thus indicating that block columns have been "loaded" even if they are blank
                if ($parentColumns == null) {
                    $parentColumns = [];
                }
                $colMap = array_merge($colMap, $parentColumns);
            }
        }
        return $colMap;
    }
public function getAllColumns ( $ includeParent = true ) { // build a list of columns for this model $ metaData = $ this -> getDI ( ) -> get ( 'memory' ) ; $ colMap = $ metaData -> getColumnMap ( $ this ) ; if ( is_null ( $ colMap ) ) { // but if it isn't present, fall back to attributes $ colMap = $ metaData -> getAttributes ( $ this ) ; } if ( $ includeParent ) { $ parentModel = $ this -> getParentModel ( true ) ; if ( $ parentModel ) { /** @var BaseModel $parentModel */ $ parentModel = new $ parentModel ( ) ; $ parentColumns = $ parentModel -> getAllColumns ( true ) ; // the parent model may return null, let's catch and change to an empty array // thus indicating that block columns have been "loaded" even if they are blank if ( $ parentColumns == null ) { $ parentColumns = [ ] ; } $ colMap = array_merge ( $ colMap , $ parentColumns ) ; } } return $ colMap ; }
return what should be a full set of columns for the model
if requested, return parent columns as well

@todo sounds similar to getAllowedColumns() and loadBlockColumns()... maybe both could be merged and get DRY?
@param bool $includeParent - should the list include parent columns?
@return array
return what should be a full set of columns for the model if requested return parent columns as well