src/ORM/DataList.php
public function createDataObject($row)
    {
        $class = $this->dataClass;

        if (empty($row['ClassName'])) {
            $row['ClassName'] = $class;
        }

        // Failover from RecordClassName to ClassName
        if (empty($row['RecordClassName'])) {
            $row['RecordClassName'] = $row['ClassName'];
        }

        // Instantiate the class mentioned in RecordClassName only if it exists, otherwise default to $this->dataClass
        if (class_exists($row['RecordClassName'])) {
            $class = $row['RecordClassName'];
        }

        $item = Injector::inst()->create($class, $row, false, $this->getQueryParams());

        return $item;
    }
public function createDataObject($row)
    {
        $class = $this->dataClass;

        if (empty($row['ClassName'])) {
            $row['ClassName'] = $class;
        }

        // Failover from RecordClassName to ClassName
        if (empty($row['RecordClassName'])) {
            $row['RecordClassName'] = $row['ClassName'];
        }

        // Instantiate the class mentioned in RecordClassName only if it exists, otherwise default to $this->dataClass
        if (class_exists($row['RecordClassName'])) {
            $class = $row['RecordClassName'];
        }

        $item = Injector::inst()->create($class, $row, false, $this->getQueryParams());

        return $item;
    }
public function createDataObject ( $ row ) { $ class = $ this -> dataClass ; if ( empty ( $ row [ 'ClassName' ] ) ) { $ row [ 'ClassName' ] = $ class ; } // Failover from RecordClassName to ClassName if ( empty ( $ row [ 'RecordClassName' ] ) ) { $ row [ 'RecordClassName' ] = $ row [ 'ClassName' ] ; } // Instantiate the class mentioned in RecordClassName only if it exists, otherwise default to $this->dataClass if ( class_exists ( $ row [ 'RecordClassName' ] ) ) { $ class = $ row [ 'RecordClassName' ] ; } $ item = Injector :: inst ( ) -> create ( $ class , $ row , false , $ this -> getQueryParams ( ) ) ; return $ item ; }
Create a DataObject from the given SQL row

@param array $row
@return DataObject
Create a DataObject from the given SQL row