Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Many To Many

$
0
0
hello , i need to get values from a many to many relation and it is not working.

have
public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			
			'projetos' => array(self::MANY_MANY, 'Projetos',           'utilizador_projeto(utilizador, cod_projeto)'),
			
		        
                    );
	}


and $user = Utilizadores::model()->With('projetos')->findByAttributes( array( 'utilizador' => $this->username));

CVarDumper::dump($user->projectos->utilizador_projecto->utilizador); dont work

Property "Utilizadores.projectos" is not defined.

  • : Screenshot from 2013-04-08 17:39:51.png

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>