protected function normalizeListParentParameter($parent)
    {
        $separator = $this->getListParentSeparator();

        if (is_integer($parent) && $parent < 0 || is_string($parent) && preg_match('#-\d+#', $parent)) {
            $parent = (int) $parent;

            if ($parent < 0) {
                // The the parent that conforms to the index in the parent chain
                // This only works within the context of this model, so no cross-model logic is expected
                $index = count($this->listParents) + $parent - 1;

                if ($index >= 0 && isset($this->listParents[ $index ])) {
                    $parent = $this->listParents[ $index ]->relation . $separator . $this->listParents[ $index ]->key;
                } else {
                    $parent = null;
                }

            } else {
                $parent = null;
            }
        }

        if (is_string($parent) && false === strpos($parent, $separator)) {
            $parent = null;
        }

        return $parent;
    }
protected function normalizeListParentParameter($parent)
    {
        $separator = $this->getListParentSeparator();

        if (is_integer($parent) && $parent < 0 || is_string($parent) && preg_match('#-\d+#', $parent)) {
            $parent = (int) $parent;

            if ($parent < 0) {
                // The the parent that conforms to the index in the parent chain
                // This only works within the context of this model, so no cross-model logic is expected
                $index = count($this->listParents) + $parent - 1;

                if ($index >= 0 && isset($this->listParents[ $index ])) {
                    $parent = $this->listParents[ $index ]->relation . $separator . $this->listParents[ $index ]->key;
                } else {
                    $parent = null;
                }

            } else {
                $parent = null;
            }
        }

        if (is_string($parent) && false === strpos($parent, $separator)) {
            $parent = null;
        }

        return $parent;
    }
protected function normalizeListParentParameter ( $ parent ) { $ separator = $ this -> getListParentSeparator ( ) ; if ( is_integer ( $ parent ) && $ parent < 0 || is_string ( $ parent ) && preg_match ( '#-\d+#' , $ parent ) ) { $ parent = ( int ) $ parent ; if ( $ parent < 0 ) { // The the parent that conforms to the index in the parent chain // This only works within the context of this model, so no cross-model logic is expected $ index = count ( $ this -> listParents ) + $ parent - 1 ; if ( $ index >= 0 && isset ( $ this -> listParents [ $ index ] ) ) { $ parent = $ this -> listParents [ $ index ] -> relation . $ separator . $ this -> listParents [ $ index ] -> key ; } else { $ parent = null ; } } else { $ parent = null ; } } if ( is_string ( $ parent ) && false === strpos ( $ parent , $ separator ) ) { $ parent = null ; } return $ parent ; }
Normalizes 'parent' query parameter for list parent update.

@param mixed $parent
@return int|null
Normalizes parent query parameter for list parent update .