Maybe this is a simple question, but I do not know how to contact it. I have an HABT-relative between I would like get all podcasts of the logged-in user Obtaining 1 all podcasts: I have this model / podcast.php UsersController.php 2 < P> The cake email is very well documented here with examples, explanations ... etc Here: podcast and
user and its original baked app is in
CakePHP 2.3.6 . A user can "subscribe" to the podcast.
debug ($ this-> viewVars) I will show that the array is
wrong why?
public function getPodcastsByUserId ($ userId = null) {if (empty ($ userId)) returned incorrectly; $ Podcasts = $ this- & gt; Search ('all', array ('joins' = & gt; array (array (' table '= & gt;' podcasts' euseer ',' nickname '= & gt;' podcast user ',' type '= & gt; INNER ',' conditions' = & gt; array ('podcasts user.user_id' = & gt; $ userId, 'podcastususerpodcast_id = podcast.id'))), 'group' = & gt; 'podcast.ed'); Return podcast;}
public function showMyPodcasts () {$ userId = $ this- & gt; Session-> Read ('Auth.User.Id'); $ this-> LoadModel ('podcast'); $ podcast = $ this- & gt; podcast- & gt; GetPodcastsByUserId ($ userId); $ this- & gt; set ('podcast', $ podcast);}
No comments:
Post a Comment