im a newbie here just trying out Yii, by using it to a pet project,
actually its just a simple bookmarking website,
where any registered user can manage his/her own list of bookmarks.
so, just setting the context
-
i already created a sqlite3 database including the required tables/schemas.
(including the proper primary keys and foreign keys and necessary pragma to enable fk).
-
properly setup Yii’s basic framework using yiic (im using wamp)
-
and used the Gii module for creating models and crud ops
here’s my sample database model
-
Category model (just a lookup, categoryID + category)
-
Bookmark model (contains a simple title+url and the category)
so basically, if i want to know the category(text) of a bookmark,
i just need to "$bookmark->category->Category",
and the "lazy loading" approach of Yii will implicitly fetch the value from the database. right?
now, here’s my problem, the “lazy loading” part just wont’ work.
it just shows an error something in the line of "accessing property of a non object"
(btw, im in office that’s why i cant paste the exact text)
i thought, the "$bookmark->category" is returning a null reference,
so im stucked with it. i’ve searched the forum/wiki if there’s a thread related to this
but found none.
so there, please help me.
is it possible that i missed a configuration
or code that i need to implement for this to work?
any help will be appreciated,
thanks guys
btw, when i use MySql(using the latest version), it works perfectly.
just dont know why.