Library/Bullhorn/FastRest/Generator/ModelBuilder.php
private function buildRelationshipsList() {
        $content = '		return array(' . "\n";
        $added = false;
        foreach($this->getRelationships() as $relationship) {
            if(!$relationship->isPlural()) {
                $added = true;
                $content .= '			\'' . $relationship->getAlias() . '\',' . "\n";
            }
        }
        if($added) {
            $content = substr($content, 0, -2) . "\n"; //Remove trailing comma
        }
        $content .= '		);';
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('Returns a list of all parent relationships, these will all return a Base Model instance');
        $method->setName('getParentRelationships');
        $method->setReturnType('string[] values are the alias of the relationship');
        $method->setContent($content);
        $this->getAbstractClass()->addMethod($method);

        $content = '		return array(' . "\n";
        $added = false;
        foreach($this->getRelationships() as $relationship) {
            if($relationship->isPlural()) {
                $added = true;
                $content .= '			\'' . $relationship->getAlias() . '\',' . "\n";
            }
        }
        if($added) {
            $content = substr($content, 0, -2) . "\n"; //Remove trailing comma
        }
        $content .= '		);';
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('Returns a list of all children relationships, these will all return a ResultSet');
        $method->setName('getChildrenRelationships');
        $method->setReturnType('string[] values are the alias of the relationship');
        $method->setContent($content);
        $this->getAbstractClass()->addMethod($method);

    }
private function buildRelationshipsList() {
        $content = '		return array(' . "\n";
        $added = false;
        foreach($this->getRelationships() as $relationship) {
            if(!$relationship->isPlural()) {
                $added = true;
                $content .= '			\'' . $relationship->getAlias() . '\',' . "\n";
            }
        }
        if($added) {
            $content = substr($content, 0, -2) . "\n"; //Remove trailing comma
        }
        $content .= '		);';
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('Returns a list of all parent relationships, these will all return a Base Model instance');
        $method->setName('getParentRelationships');
        $method->setReturnType('string[] values are the alias of the relationship');
        $method->setContent($content);
        $this->getAbstractClass()->addMethod($method);

        $content = '		return array(' . "\n";
        $added = false;
        foreach($this->getRelationships() as $relationship) {
            if($relationship->isPlural()) {
                $added = true;
                $content .= '			\'' . $relationship->getAlias() . '\',' . "\n";
            }
        }
        if($added) {
            $content = substr($content, 0, -2) . "\n"; //Remove trailing comma
        }
        $content .= '		);';
        $method = new Object\Method();
        $method->setAccess('public');
        $method->setDescription('Returns a list of all children relationships, these will all return a ResultSet');
        $method->setName('getChildrenRelationships');
        $method->setReturnType('string[] values are the alias of the relationship');
        $method->setContent($content);
        $this->getAbstractClass()->addMethod($method);

    }
private function buildRelationshipsList ( ) { $ content = '		return array(' . "\n" ; $ added = false ; foreach ( $ this -> getRelationships ( ) as $ relationship ) { if ( ! $ relationship -> isPlural ( ) ) { $ added = true ; $ content .= '			\'' . $ relationship -> getAlias ( ) . '\',' . "\n" ; } } if ( $ added ) { $ content = substr ( $ content , 0 , - 2 ) . "\n" ; //Remove trailing comma } $ content .= '		);' ; $ method = new Object \ Method ( ) ; $ method -> setAccess ( 'public' ) ; $ method -> setDescription ( 'Returns a list of all parent relationships, these will all return a Base Model instance' ) ; $ method -> setName ( 'getParentRelationships' ) ; $ method -> setReturnType ( 'string[] values are the alias of the relationship' ) ; $ method -> setContent ( $ content ) ; $ this -> getAbstractClass ( ) -> addMethod ( $ method ) ; $ content = '		return array(' . "\n" ; $ added = false ; foreach ( $ this -> getRelationships ( ) as $ relationship ) { if ( $ relationship -> isPlural ( ) ) { $ added = true ; $ content .= '			\'' . $ relationship -> getAlias ( ) . '\',' . "\n" ; } } if ( $ added ) { $ content = substr ( $ content , 0 , - 2 ) . "\n" ; //Remove trailing comma } $ content .= '		);' ; $ method = new Object \ Method ( ) ; $ method -> setAccess ( 'public' ) ; $ method -> setDescription ( 'Returns a list of all children relationships, these will all return a ResultSet' ) ; $ method -> setName ( 'getChildrenRelationships' ) ; $ method -> setReturnType ( 'string[] values are the alias of the relationship' ) ; $ method -> setContent ( $ content ) ; $ this -> getAbstractClass ( ) -> addMethod ( $ method ) ; }
Builds the relationships list methods
@return void
Builds the relationships list methods