Example #1
0
 /**
  * Transform raw database row to node compatible row.
  *
  * @param array $row raw database row
  * @param Query $query query object
  * @param array $attrsByLoadType attributes by load type
  *
  * @return array node compatible row
  */
 protected function _transformRow($row, Query $query, array $attrsByLoadType)
 {
     $query->deAlias($row);
     Tools::atkDataDecode($row);
     $result = [];
     foreach ($attrsByLoadType[Attribute::ADDTOQUERY] as $attr) {
         $result[$attr->fieldName()] = $attr->db2value($row);
     }
     if (!$this->m_ignorePrimaryKey) {
         $result['atkprimkey'] = $this->_getNode()->primaryKey($result);
     }
     foreach ($attrsByLoadType[Attribute::POSTLOAD] as $attr) {
         $result[$attr->fieldName()] = $attr->load($this->_getDb(), $result, $this->m_mode);
     }
     return $result;
 }