public function addToListArrayHeader($action, &$arr, $fieldprefix, $flags, $atksearch, $columnConfig, DataGrid $grid = null, $column = '*') { if ($this->hasFlag(self::AF_HIDE_LIST) || !$this->createDestination()) { return; } if (!$this->hasFlag(self::AF_ONETOONE_INTEGRATE) && $column == '*' || $column == null) { // regular behaviour. parent::addToListArrayHeader($action, $arr, $fieldprefix, $flags, $atksearch, $columnConfig, $grid, $column); return; } else { if (!$this->hasFlag(self::AF_ONETOONE_INTEGRATE) || $column != '*' && $this->getDestination()->getAttribute($column) == null) { throw new \Exception("Invalid list column {$column} for atkOneToOneRelation " . $this->getOwnerInstance()->atkNodeUri() . '::' . $this->fieldName()); } } // integrated version, don't add ourselves, but add all columns from the destination. $prefix = $fieldprefix . $this->fieldName() . '_AE_'; foreach (array_keys($this->m_destInstance->m_attribList) as $attribname) { if ($column != '*' && $column != $attribname) { continue; } $p_attrib = $this->m_destInstance->getAttribute($attribname); $p_attrib->addToListArrayHeader($action, $arr, $prefix, $flags, $atksearch[$this->fieldName()], $columnConfig, $grid, null); } }
public function addToListArrayHeader($action, &$arr, $fieldprefix, $flags, $atksearch, $columnConfig, DataGrid $grid = null, $column = '*') { if ($column == null || $column == '*') { $prefix = $fieldprefix . $this->fieldName() . '_AE_'; parent::addToListArrayHeader($action, $arr, $prefix, $flags, $atksearch[$this->fieldName()], $columnConfig, $grid, null); } if ($column == '*') { // only add extra columns when needed if ($this->hasFlag(self::AF_HIDE_LIST) && !$this->m_alwaysShowListColumns) { return; } if (!$this->createDestination() || count($this->m_listColumns) == 0) { return; } foreach ($this->m_listColumns as $column) { $this->_addColumnToListArrayHeader($column, $action, $arr, $fieldprefix, $flags, $atksearch, $columnConfig, $grid); } } else { if ($column != null) { $this->_addColumnToListArrayHeader($column, $action, $arr, $fieldprefix, $flags, $atksearch, $columnConfig, $grid); } } }