Items guide
Using Items in your Cherrycake application brings you many benefits when interacting with the primordial objects of your app, like optimized loading, storage, caching and embedded security mechanisms.
Creating an Item class
<?php
namespace CherrycakeApp;
class Movie extends \Cherrycake\Item {
protected $tableName = "movies";
protected $fields = [
"id" => [
"type" => \Cherrycake\DATABASE_FIELD_TYPE_INTEGER
],
"title" => [
"type" => \Cherrycake\DATABASE_FIELD_TYPE_STRING
],
"summary" => [
"type" => \Cherrycake\DATABASE_FIELD_TYPE_TEXT
],
"year" => [
"type" => \Cherrycake\DATABASE_FIELD_TYPE_YEAR
],
"imdbRating" => [
"type" => \Cherrycake\DATABASE_FIELD_TYPE_FLOAT
]
];
}Last updated