public function update(array $cleanData, $isInit = false)
    {
        if ($isInit) {
            $attrs = $this->getAttrs();
            foreach ($cleanData as $key => $value) {
                if (($value instanceof Model) && isset($attrs[$key]) && isset($attrs[$key]['type'])
                    && ( $attrs[$key]['type'] == self::DATA_TYPE_REFERENCE || $attrs[$key]['type'] == self::DATA_TYPE_REFERENCES )
                ) {
                    $value = $this->setRef($key, $value);
                }
                $this->cleanData[$key] = $value;
            }
        } else {
            foreach ($cleanData as $key => $value) {
                $this->$key = $value;
            }
        }

        return true;
    }
public function update(array $cleanData, $isInit = false)
    {
        if ($isInit) {
            $attrs = $this->getAttrs();
            foreach ($cleanData as $key => $value) {
                if (($value instanceof Model) && isset($attrs[$key]) && isset($attrs[$key]['type'])
                    && ( $attrs[$key]['type'] == self::DATA_TYPE_REFERENCE || $attrs[$key]['type'] == self::DATA_TYPE_REFERENCES )
                ) {
                    $value = $this->setRef($key, $value);
                }
                $this->cleanData[$key] = $value;
            }
        } else {
            foreach ($cleanData as $key => $value) {
                $this->$key = $value;
            }
        }

        return true;
    }
public function update ( array $ cleanData , $ isInit = false ) { if ( $ isInit ) { $ attrs = $ this -> getAttrs ( ) ; foreach ( $ cleanData as $ key => $ value ) { if ( ( $ value instanceof Model ) && isset ( $ attrs [ $ key ] ) && isset ( $ attrs [ $ key ] [ 'type' ] ) && ( $ attrs [ $ key ] [ 'type' ] == self :: DATA_TYPE_REFERENCE || $ attrs [ $ key ] [ 'type' ] == self :: DATA_TYPE_REFERENCES ) ) { $ value = $ this -> setRef ( $ key , $ value ) ; } $ this -> cleanData [ $ key ] = $ value ; } } else { foreach ( $ cleanData as $ key => $ value ) { $ this -> $ key = $ value ; } } return true ; }
Update data by a array

@param array $cleanData clean data
@param bool  $isInit    is init

@return boolean
Update data by a array