Skip to content

Instantly share code, notes, and snippets.

@tomwalder
Created July 9, 2015 10:20
Show Gist options
  • Save tomwalder/d0728aaa7453d13725fe to your computer and use it in GitHub Desktop.
Save tomwalder/d0728aaa7453d13725fe to your computer and use it in GitHub Desktop.
Example GDS create with long strings
<?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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment