Skip to content

Instantly share code, notes, and snippets.

Created March 31, 2015 23:30
Show Gist options
  • Save anonymous/a7dc114c2eb5312f2fbf to your computer and use it in GitHub Desktop.
Save anonymous/a7dc114c2eb5312f2fbf to your computer and use it in GitHub Desktop.
<?php
namespace Model;
class Trip extends \Orm\Model {
protected static $_belongs_to = array(
'user' => array(
'key_from' => 'user_id',
'model_to' => '\Model\Auth_User',
'key_to' => 'id',
)
);
protected static $_has_one = array(
'category' => array(
'key_from' => 'category_id',
'model_to' => '\Model\Trip_Category',
'key_to' => 'id'
)
);
protected static $_properties = array(
'id',
'user_id',
'category_id',
'title',
'mileage',
'gps_max_speed',
'gps_average_speed',
'gps_path' => array(
'data_type' => 'json',
'default' => null,
),
'notes',
'created_at',
'updated_at',
'finalized_at',
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment