lib/db/cortex.php
function copyto_flat($key) {
		/** @var \Base $f3 */
		$f3 = \Base::instance();
		$this->copyto($key);
		foreach ($this->fields() as $field) {
			if (isset($this->fieldConf[$field]) && isset($this->fieldConf[$field]['relType'])
				&& $this->fieldConf[$field]['relType']=='has-many'
				&& $f3->devoid($key.'.'.$field)) {
				$val = $this->get($field);
				if ($val instanceof CortexCollection)
					$f3->set($key.'.'.$field,$val->getAll('_id'));
				elseif (is_array($val))
					$f3->set($key.'.'.$field,$val);
				else
					$f3->clear($key.'.'.$field);
			}
		}
	}
function copyto_flat($key) {
		/** @var \Base $f3 */
		$f3 = \Base::instance();
		$this->copyto($key);
		foreach ($this->fields() as $field) {
			if (isset($this->fieldConf[$field]) && isset($this->fieldConf[$field]['relType'])
				&& $this->fieldConf[$field]['relType']=='has-many'
				&& $f3->devoid($key.'.'.$field)) {
				$val = $this->get($field);
				if ($val instanceof CortexCollection)
					$f3->set($key.'.'.$field,$val->getAll('_id'));
				elseif (is_array($val))
					$f3->set($key.'.'.$field,$val);
				else
					$f3->clear($key.'.'.$field);
			}
		}
	}
function copyto_flat ( $ key ) { /** @var \Base $f3 */ $ f3 = \ Base :: instance ( ) ; $ this -> copyto ( $ key ) ; foreach ( $ this -> fields ( ) as $ field ) { if ( isset ( $ this -> fieldConf [ $ field ] ) && isset ( $ this -> fieldConf [ $ field ] [ 'relType' ] ) && $ this -> fieldConf [ $ field ] [ 'relType' ] == 'has-many' && $ f3 -> devoid ( $ key . '.' . $ field ) ) { $ val = $ this -> get ( $ field ) ; if ( $ val instanceof CortexCollection ) $ f3 -> set ( $ key . '.' . $ field , $ val -> getAll ( '_id' ) ) ; elseif ( is_array ( $ val ) ) $ f3 -> set ( $ key . '.' . $ field , $ val ) ; else $ f3 -> clear ( $ key . '.' . $ field ) ; } } }
copy to hive key with relations being simple arrays of keys
@param $key
copy to hive key with relations being simple arrays of keys