src/ORM/ManyManyList.php
public function createDataObject($row)
    {
        // remove any composed fields
        $add = [];

        if ($this->_compositeExtraFields) {
            foreach ($this->_compositeExtraFields as $fieldName => $composed) {
                // convert joined extra fields into their composite field types.
                $value = [];

                foreach ($composed as $subField) {
                    if (isset($row[$fieldName . $subField])) {
                        $value[$subField] = $row[$fieldName . $subField];

                        // don't duplicate data in the record
                        unset($row[$fieldName . $subField]);
                    }
                }

                $obj = Injector::inst()->create($this->extraFields[$fieldName], $fieldName);
                $obj->setValue($value, null, false);
                $add[$fieldName] = $obj;
            }
        }

        $dataObject = parent::createDataObject($row);

        foreach ($add as $fieldName => $obj) {
            $dataObject->$fieldName = $obj;
        }

        return $dataObject;
    }
public function createDataObject($row)
    {
        // remove any composed fields
        $add = [];

        if ($this->_compositeExtraFields) {
            foreach ($this->_compositeExtraFields as $fieldName => $composed) {
                // convert joined extra fields into their composite field types.
                $value = [];

                foreach ($composed as $subField) {
                    if (isset($row[$fieldName . $subField])) {
                        $value[$subField] = $row[$fieldName . $subField];

                        // don't duplicate data in the record
                        unset($row[$fieldName . $subField]);
                    }
                }

                $obj = Injector::inst()->create($this->extraFields[$fieldName], $fieldName);
                $obj->setValue($value, null, false);
                $add[$fieldName] = $obj;
            }
        }

        $dataObject = parent::createDataObject($row);

        foreach ($add as $fieldName => $obj) {
            $dataObject->$fieldName = $obj;
        }

        return $dataObject;
    }
public function createDataObject ( $ row ) { // remove any composed fields $ add = [ ] ; if ( $ this -> _compositeExtraFields ) { foreach ( $ this -> _compositeExtraFields as $ fieldName => $ composed ) { // convert joined extra fields into their composite field types. $ value = [ ] ; foreach ( $ composed as $ subField ) { if ( isset ( $ row [ $ fieldName . $ subField ] ) ) { $ value [ $ subField ] = $ row [ $ fieldName . $ subField ] ; // don't duplicate data in the record unset ( $ row [ $ fieldName . $ subField ] ) ; } } $ obj = Injector :: inst ( ) -> create ( $ this -> extraFields [ $ fieldName ] , $ fieldName ) ; $ obj -> setValue ( $ value , null , false ) ; $ add [ $ fieldName ] = $ obj ; } } $ dataObject = parent :: createDataObject ( $ row ) ; foreach ( $ add as $ fieldName => $ obj ) { $ dataObject -> $ fieldName = $ obj ; } return $ dataObject ; }
Create a DataObject from the given SQL row.

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