Library/Bullhorn/FastRest/Api/Services/ControllerHelper/Save.php
private function writeFields($fields, ApiInterface $entity, bool $writeChildren): bool {
        $isChanged = false;
        foreach($fields as $name => $value) {
            if($this->getAcl()->canWriteField($entity, $name)) {
                try {
                    if(array_key_exists($name, $entity->getChildrenUpdaters())) {
                        if($writeChildren) {
                            $entity->getChildrenUpdaters()[$name]->setData($entity, $value);
                            $isChanged = true;
                        }
                    } else {
                        $entity->writeAttribute($name, $value);
                    }
                } catch(\InvalidArgumentException $e) {
                    throw new CatchableException($e->getMessage());
                }
            }
        }
        return $isChanged;
    }
private function writeFields($fields, ApiInterface $entity, bool $writeChildren): bool {
        $isChanged = false;
        foreach($fields as $name => $value) {
            if($this->getAcl()->canWriteField($entity, $name)) {
                try {
                    if(array_key_exists($name, $entity->getChildrenUpdaters())) {
                        if($writeChildren) {
                            $entity->getChildrenUpdaters()[$name]->setData($entity, $value);
                            $isChanged = true;
                        }
                    } else {
                        $entity->writeAttribute($name, $value);
                    }
                } catch(\InvalidArgumentException $e) {
                    throw new CatchableException($e->getMessage());
                }
            }
        }
        return $isChanged;
    }
private function writeFields ( $ fields , ApiInterface $ entity , bool $ writeChildren ) : bool { $ isChanged = false ; foreach ( $ fields as $ name => $ value ) { if ( $ this -> getAcl ( ) -> canWriteField ( $ entity , $ name ) ) { try { if ( array_key_exists ( $ name , $ entity -> getChildrenUpdaters ( ) ) ) { if ( $ writeChildren ) { $ entity -> getChildrenUpdaters ( ) [ $ name ] -> setData ( $ entity , $ value ) ; $ isChanged = true ; } } else { $ entity -> writeAttribute ( $ name , $ value ) ; } } catch ( \ InvalidArgumentException $ e ) { throw new CatchableException ( $ e -> getMessage ( ) ) ; } } } return $ isChanged ; }
Writes the actual fields

@param string[] $fields
@param ApiInterface $entity

@return bool
Writes the actual fields