public function getEntityGenerator( PgClass $pgclass, array $options, $entityFileStore )
    {

        // build entity
        $tags = $this->getNormalityTags();

        $generators = array(
            'Entity' => '\Bond\Normality\Generate\Entity',
            'Link' => '\Bond\Normality\Generate\Entity\Link',
            'Child' => '\Bond\Normality\Generate\Entity\Child',
        );

        if( isset( $tags['entity'] ) ) {
            $entity = $tags['entity'];
        } elseif ( $parent = $this->get('parent') ) {
            $entity = 'Child';
        } else {
            $entity = 'Entity';
        }

        foreach( $generators as $key => $generator ) {

            if( in_array( strtolower( $entity ), array( strtolower( $key ), strtolower( $generator ) ) ) ) {

                $ref = new \ReflectionClass( $generator );
                return $ref->newInstance( $this, $db, $options, $entityFileStore );

            }

        }

        throw new \RuntimeException( "No generator found for `{entity}` and relation `{$this->get('name')}`" );

    }
public function getEntityGenerator( PgClass $pgclass, array $options, $entityFileStore )
    {

        // build entity
        $tags = $this->getNormalityTags();

        $generators = array(
            'Entity' => '\Bond\Normality\Generate\Entity',
            'Link' => '\Bond\Normality\Generate\Entity\Link',
            'Child' => '\Bond\Normality\Generate\Entity\Child',
        );

        if( isset( $tags['entity'] ) ) {
            $entity = $tags['entity'];
        } elseif ( $parent = $this->get('parent') ) {
            $entity = 'Child';
        } else {
            $entity = 'Entity';
        }

        foreach( $generators as $key => $generator ) {

            if( in_array( strtolower( $entity ), array( strtolower( $key ), strtolower( $generator ) ) ) ) {

                $ref = new \ReflectionClass( $generator );
                return $ref->newInstance( $this, $db, $options, $entityFileStore );

            }

        }

        throw new \RuntimeException( "No generator found for `{entity}` and relation `{$this->get('name')}`" );

    }
public function getEntityGenerator ( PgClass $ pgclass , array $ options , $ entityFileStore ) { // build entity $ tags = $ this -> getNormalityTags ( ) ; $ generators = array ( 'Entity' => '\Bond\Normality\Generate\Entity' , 'Link' => '\Bond\Normality\Generate\Entity\Link' , 'Child' => '\Bond\Normality\Generate\Entity\Child' , ) ; if ( isset ( $ tags [ 'entity' ] ) ) { $ entity = $ tags [ 'entity' ] ; } elseif ( $ parent = $ this -> get ( 'parent' ) ) { $ entity = 'Child' ; } else { $ entity = 'Entity' ; } foreach ( $ generators as $ key => $ generator ) { if ( in_array ( strtolower ( $ entity ) , array ( strtolower ( $ key ) , strtolower ( $ generator ) ) ) ) { $ ref = new \ ReflectionClass ( $ generator ) ; return $ ref -> newInstance ( $ this , $ db , $ options , $ entityFileStore ) ; } } throw new \ RuntimeException ( "No generator found for `{entity}` and relation `{$this->get('name')}`" ) ; }
Get the entity type. Defaults to 'base'. Set by '@normality-entity: ignore';
The code that handles the output of this function can be found in 'Normality::buildRelation';
@return string
Get the entity type . Defaults to base . Set by