magento - Fatal error: Call to a member function join() on a non-object? -


I am creating a slideshow and I include my slideshow table and my images in the table through this slide Unfortunately, this error is happening:

Call the "Fatal Error: Any Non-Object"

when the member functions are included: Here is the code :

  $ Diaporama = Mage :: getModel ('dioroma / dioporama') - & gt; Meet compilation (); $ Diaporama-> Join (array ('Images' = & gt; 'Diaproma / Images'), 'Main_table.id = Images', Arrays ('*')) - & gt; Set order ('status', 'esque'); $ Diaporama-> Load (); Return $ diaporama;  

Does anyone see where I am wrong?


Update: OK, now my first problem has been solved, I have successfully displayed data on my block. I still have a problem in my query because I only got the first image data of my slideshow to know that I have 2 tables:

Diaporama: - ID - Title - Disclaimer

Diaphragm_is: - ID -

  diaporama = array ('id') -  

< / P>

'title' description '' picture '= & gt; Array (array ('id' => gt; '', 'title' => gt; '' 'description' => '', 'src' = & gt; '' alt '= & gt; ; '', 'Position' = & gt; ''), array ('id' = & gt; '' 'title' => '', 'description' => '', '' Src ' = & Gt; '', 'alt' =>, '' position '=>' ')))

And at this time I am still away


Update 2

I updated my code like this:

  $ diaporama = mage :: getModel ('diaporama / diaporama' ) - & gt; GetCollecti (); $ Diaporama-> Join (array ('picture' = & gt; 'dopamma / images'), 'main_table.id = painting. Dopirama_id', array ('*')) - & gt; Set order ('position', 'esque') - & gt; Load (); Return $ diaporama;  

But I still have Diaporama table fields missing. My current results here are sample data with random images. I diaporama table fields data is still missing. With random images found on the internet here The result is

  array (size = 3) 0 = & gt; Array (size = 7) 'id' = & gt; String '1' (length = 1) 'title' = & gt; String 'Uniteb Yacht' (length = 16) 'Description' = & gt; String 'La description de un superbay yacht' (length = 33) 'src' = & gt; String 'http://aboutyacht.com/wp/wp-content/uploads/2012/09/12_diaporama-980x360.jpg' (length = 76) 'alt' = & gt; String 'yacht 1' (length = 6) 'position' = & gt; String '1' (length = 1) 'dyoporama_id' = & gt; String '1' (length = 1) 1 = & gt; Array (size = 7) 'id' = & gt; String '2' (length = 1) 'title' = & gt; String 'Yacht InterAir' (length = 15) 'Description' = & gt; String 'L interier de un super yacht' (length = 28) 'src' = & gt; The string 'http://aboutyacht.com/wp/wp-content/uploads/2012/09/1_diaporama-980x360.jpg' (length = 75) 'alt' = & gt; String 'instrument yacht' (length = 15) 'position' = & gt; String '2' (length = 1) 'diaporama_id' = & gt; Last edit: The problem is resolved.  

The last update was not working, it was just getting all the images from my desk, so I finally forgot about joining () method and I resolved it like this:

  $ diaporama = mage :: getModel ('diaporama / diaporama') - & gt; Load ($ ID); AddFieldToSelect ('*') - & gt; AddFieldToFilter ('diaporama_id', $ id) - & gt; Set Order ('Status', 'ACC') - & gt; $ Images = Mage :: getResourceModel ('diaporama / images_collection') - & gt; AddFieldToSelect ('*') - & gt; ; Weight (); Returns array ('dioporama' => $ diaporama, 'images' = & gt; $ images);  

By the plate my slideshow and images are sorted according to the display position.

Why does your collection of reverse tap make var_dump ($ diaporama) before you join? Also, check out system.log and your Apache log to give us more information. You may find that the path of the model you are trying to do the institute for the institute can be found.

UPDATE:

It is OK that you get the main table in the Image Table ID Joining the ID you are removing the result of pure luck. You are not joining the key of your forge 'main_table.id = images.diaporama_id'?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -