Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Define our Model Schema
- $obj_book_schema = (new GDS\Schema('Book'))
- ->addString('title')
- ->addString('author')
- ->addString('isbn', TRUE)
- ->addDatetime('published', FALSE)
- ->addString('text', FALSE);
- // Store requires a Gateway and Schema
- $obj_book_store = new GDS\Store($obj_book_schema);
- // So now create a simple Model object
- $obj_book = new GDS\Entity();
- $obj_book->title = 'Romeo and Juliet 1';
- $obj_book->author = 'WilliamShakespeare';
- $obj_book->isbn = '1840224339';
- $obj_book->published = date('Y-m-d H:i:s');
- $obj_book->text = str_repeat('x', 4000);
- // Insert
- $obj_book_store->upsert($obj_book);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement