3060 Posts in 864 Topics by 646 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 233 Views |
-
Using Dataobject in Sapphire Framework

20 October 2012 at 1:27am
For a new project I tried the standalone Sapphire framework. I got it up and running, but have no idea how to use the Dataobject apart from the CMS.
All I want to do is saving a simple data set to the database. Therefor I created an Databobject, but when I try to create a new object in the controller, I end up with the error "Class not found".Can someone give me a hint, or is the a beginners guide for the framework.
-
Re: Using Dataobject in Sapphire Framework

24 October 2012 at 8:26pm
DataObject is part of the framework. You can create objects using $obj = new NameofYourObject();
You won't be able to create Page dataobjects (that's part of the CMS)
-
Re: Using Dataobject in Sapphire Framework

24 October 2012 at 11:06pm
Didn't work for me. I tried to initialize a new DataObject in my controller with $my_object = new MyDataObject(); but just end up with the error "Fatal error: Class 'MyDataObjectt' not found..."
Do I have to build, load the DataObject somewhere?
The DataObject is pretty basic stuff, just contains some DB fields:
class MyDataObject extends DataObject {
static $db = array(
'ID' => 'Int'
// other stuff
);
} -
Re: Using Dataobject in Sapphire Framework

25 October 2012 at 9:08pm
Is your new DataObject class being picked up by the manifest? If you run a dev/build you should see it listed (as well as in your database).
-
Re: Using Dataobject in Sapphire Framework

25 October 2012 at 10:00pm
Actually it wasn't, thanks for pointing it out!
I kind of messed up the routes.yml, so the build didn't work for me >.< To be honest I don't really understand this file so far, it's more like try and error. But I guess it will get easier with the time.
Sapphire is great fun to work with.
| 233 Views | ||
|
Page:
1
|
Go to Top |

