protected function extractNodes(CNabuDataObject $item)
    {
        $retval = null;

        if ($item instanceof INabuTranslated) {
            if ($item->hasTranslations()) {
                $nodes = array();
                $main_index_name = $this->list->getIndexedFieldName();
                $item->getTranslations()->iterate(
                    function ($key, $translation) use (&$nodes, $main_index_name, $item) {
                        if (($translation->isValueNumeric($main_index_name) ||
                             $translation->isValueGUID($main_index_name)
                            ) &&
                            ($translation->isValueString($this->key_field) ||
                             $translation->isValueNumeric($this->key_field)
                            )
                        ) {
                            $key = $translation->getValue($this->key_field);
                            $nodes[$key] = array(
                                'key' => $key,
                                'pointer' => $translation->getValue($main_index_name)
                            );
                            if ($translation->isValueNumeric($this->order_field) ||
                                $translation->isValueString($this->order_field)
                            ) {
                                $nodes[$key]['order'] = $translation->getValue($this->order_field);
                            } elseif ($item->isValueNumeric($this->order_field) ||
                                $item->isValueString($this->order_field)
                            ) {
                                $nodes[$key]['order'] = $item->getValue($this->order_field);
                            }
                        }
                    }
                );
                if (count($nodes) > 0) {
                    $retval = $nodes;
                }
            }
        } else {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE,
                array('$item', get_class($item))
            );
        }

        return $retval;
    }
protected function extractNodes(CNabuDataObject $item)
    {
        $retval = null;

        if ($item instanceof INabuTranslated) {
            if ($item->hasTranslations()) {
                $nodes = array();
                $main_index_name = $this->list->getIndexedFieldName();
                $item->getTranslations()->iterate(
                    function ($key, $translation) use (&$nodes, $main_index_name, $item) {
                        if (($translation->isValueNumeric($main_index_name) ||
                             $translation->isValueGUID($main_index_name)
                            ) &&
                            ($translation->isValueString($this->key_field) ||
                             $translation->isValueNumeric($this->key_field)
                            )
                        ) {
                            $key = $translation->getValue($this->key_field);
                            $nodes[$key] = array(
                                'key' => $key,
                                'pointer' => $translation->getValue($main_index_name)
                            );
                            if ($translation->isValueNumeric($this->order_field) ||
                                $translation->isValueString($this->order_field)
                            ) {
                                $nodes[$key]['order'] = $translation->getValue($this->order_field);
                            } elseif ($item->isValueNumeric($this->order_field) ||
                                $item->isValueString($this->order_field)
                            ) {
                                $nodes[$key]['order'] = $item->getValue($this->order_field);
                            }
                        }
                    }
                );
                if (count($nodes) > 0) {
                    $retval = $nodes;
                }
            }
        } else {
            throw new ENabuCoreException(
                ENabuCoreException::ERROR_UNEXPECTED_PARAM_CLASS_TYPE,
                array('$item', get_class($item))
            );
        }

        return $retval;
    }
protected function extractNodes ( CNabuDataObject $ item ) { $ retval = null ; if ( $ item instanceof INabuTranslated ) { if ( $ item -> hasTranslations ( ) ) { $ nodes = array ( ) ; $ main_index_name = $ this -> list -> getIndexedFieldName ( ) ; $ item -> getTranslations ( ) -> iterate ( function ( $ key , $ translation ) use ( & $ nodes , $ main_index_name , $ item ) { if ( ( $ translation -> isValueNumeric ( $ main_index_name ) || $ translation -> isValueGUID ( $ main_index_name ) ) && ( $ translation -> isValueString ( $ this -> key_field ) || $ translation -> isValueNumeric ( $ this -> key_field ) ) ) { $ key = $ translation -> getValue ( $ this -> key_field ) ; $ nodes [ $ key ] = array ( 'key' => $ key , 'pointer' => $ translation -> getValue ( $ main_index_name ) ) ; if ( $ translation -> isValueNumeric ( $ this -> order_field ) || $ translation -> isValueString ( $ this -> order_field ) ) { $ nodes [ $ key ] [ 'order' ] = $ translation -> getValue ( $ this -> order_field ) ; } elseif ( $ item -> isValueNumeric ( $ this -> order_field ) || $ item -> isValueString ( $ this -> order_field ) ) { $ nodes [ $ key ] [ 'order' ] = $ item -> getValue ( $ this -> order_field ) ; } } } ) ; if ( count ( $ nodes ) > 0 ) { $ retval = $ nodes ; } } } else { throw new ENabuCoreException ( ENabuCoreException :: ERROR_UNEXPECTED_PARAM_CLASS_TYPE , array ( '$item' , get_class ( $ item ) ) ) ; } return $ retval ; }
Extract Nodes list for translations in an item in this node.
@param CNabuDataObject $item Item of which will extract the nodes.
@return array Returns an array of found nodes or null when they are not available nodes.
Extract Nodes list for translations in an item in this node .