protected function getAttributesFromList(
        SimpleXMLElement $element,
        array $attributes,
        bool $ignore_empty = false
    ) : int {
        $count = 0;

        if (count($attributes) > 0) {
            foreach ($attributes as $field => $attr) {
                if (isset($element[$attr])) {
                    $value = (string)$element[$attr];
                    if ($ignore_empty || strlen($value) > 0) {
                        $this->nb_data_object->setValue($field, $value);
                        $count++;
                    }
                }
            }
        }

        return $count;
    }
protected function getAttributesFromList(
        SimpleXMLElement $element,
        array $attributes,
        bool $ignore_empty = false
    ) : int {
        $count = 0;

        if (count($attributes) > 0) {
            foreach ($attributes as $field => $attr) {
                if (isset($element[$attr])) {
                    $value = (string)$element[$attr];
                    if ($ignore_empty || strlen($value) > 0) {
                        $this->nb_data_object->setValue($field, $value);
                        $count++;
                    }
                }
            }
        }

        return $count;
    }
protected function getAttributesFromList ( SimpleXMLElement $ element , array $ attributes , bool $ ignore_empty = false ) : int { $ count = 0 ; if ( count ( $ attributes ) > 0 ) { foreach ( $ attributes as $ field => $ attr ) { if ( isset ( $ element [ $ attr ] ) ) { $ value = ( string ) $ element [ $ attr ] ; if ( $ ignore_empty || strlen ( $ value ) > 0 ) { $ this -> nb_data_object -> setValue ( $ field , $ value ) ; $ count ++ ; } } } } return $ count ; }
Get a group of attributes listed in an array.
@param SimpleXMLElement $element Element instance to get attributes.
@param array $attributes Associative array with the list of data fields as keys and the attribute name as value.
@param bool $ignore_empty If true, empty values are ignored (null, '')
@return int Returns the number of attributes setted.
Get a group of attributes listed in an array .