protected function addCrossFKIsLoaded(&$script, CrossForeignKeys $crossFKs)
    {
        $inits = [];

        if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
            $inits[] = [
                'relCol'   => $this->getCrossFKsPhpNameAffix($crossFKs, true),
                'collName' => 'combination' . ucfirst($this->getCrossFKsVarName($crossFKs)),
            ];
        } else {

            foreach ($crossFKs->getCrossForeignKeys() as $crossFK) {
                $relCol = $this->getFKPhpNameAffix($crossFK, true);
                $collName = $this->getCrossFKVarName($crossFK);

                $inits[] = [
                    'relCol' => $relCol,
                    'collName' => $collName,
                ];
            }
        }

        foreach ($inits as $init) {
            $relCol = $init['relCol'];
            $collName = $init['collName'];

            $script .= "
    /**
     * Checks if the $collName collection is loaded.
     *
     * @return bool
     */
    public function is{$relCol}Loaded()
    {
        return null !== \$this->$collName;
    }
";
        }
    }
protected function addCrossFKIsLoaded(&$script, CrossForeignKeys $crossFKs)
    {
        $inits = [];

        if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
            $inits[] = [
                'relCol'   => $this->getCrossFKsPhpNameAffix($crossFKs, true),
                'collName' => 'combination' . ucfirst($this->getCrossFKsVarName($crossFKs)),
            ];
        } else {

            foreach ($crossFKs->getCrossForeignKeys() as $crossFK) {
                $relCol = $this->getFKPhpNameAffix($crossFK, true);
                $collName = $this->getCrossFKVarName($crossFK);

                $inits[] = [
                    'relCol' => $relCol,
                    'collName' => $collName,
                ];
            }
        }

        foreach ($inits as $init) {
            $relCol = $init['relCol'];
            $collName = $init['collName'];

            $script .= "
    /**
     * Checks if the $collName collection is loaded.
     *
     * @return bool
     */
    public function is{$relCol}Loaded()
    {
        return null !== \$this->$collName;
    }
";
        }
    }
protected function addCrossFKIsLoaded ( & $ script , CrossForeignKeys $ crossFKs ) { $ inits = [ ] ; if ( 1 < count ( $ crossFKs -> getCrossForeignKeys ( ) ) || $ crossFKs -> getUnclassifiedPrimaryKeys ( ) ) { $ inits [ ] = [ 'relCol' => $ this -> getCrossFKsPhpNameAffix ( $ crossFKs , true ) , 'collName' => 'combination' . ucfirst ( $ this -> getCrossFKsVarName ( $ crossFKs ) ) , ] ; } else { foreach ( $ crossFKs -> getCrossForeignKeys ( ) as $ crossFK ) { $ relCol = $ this -> getFKPhpNameAffix ( $ crossFK , true ) ; $ collName = $ this -> getCrossFKVarName ( $ crossFK ) ; $ inits [ ] = [ 'relCol' => $ relCol , 'collName' => $ collName , ] ; } } foreach ( $ inits as $ init ) { $ relCol = $ init [ 'relCol' ] ; $ collName = $ init [ 'collName' ] ; $ script .= "
    /**
     * Checks if the $collName collection is loaded.
     *
     * @return bool
     */
    public function is{$relCol}Loaded()
    {
        return null !== \$this->$collName;
    }
" ; } }
Adds the method that check if the referrer fkey collection is initialized.
@param string           &$script  The script will be modified in this method.
@param CrossForeignKeys $crossFKs
Adds the method that check if the referrer fkey collection is initialized .