From: Evan Prodromou <evan@prodromou.name> Date: Wed, 7 May 2008 17:15:42 +0000 (-0400) Subject: add data objects X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0fa97d6e2e296c780db78b7e88d283670adf1226;p=quix0rs-gnu-social.git add data objects darcs-hash:20080507171542-84dde-232baccc10f015e8c0e80edf0ceea4aa5c85b4b7.gz --- diff --git a/classes/Notice.php b/classes/Notice.php new file mode 100644 index 0000000000..6fe2f67556 --- /dev/null +++ b/classes/Notice.php @@ -0,0 +1,26 @@ +<?php +/** + * Table Definition for notice + */ +require_once 'DB/DataObject.php'; + +class Notice extends DB_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'notice'; // table name + public $id; // int(4) primary_key not_null + public $profile_id; // int(4) not_null + public $content; // varchar(140) + public $rendered; // varchar(140) + public $url; // varchar(255) + public $created; // datetime() not_null + public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Notice',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/classes/Profile.php b/classes/Profile.php new file mode 100644 index 0000000000..be4708a557 --- /dev/null +++ b/classes/Profile.php @@ -0,0 +1,28 @@ +<?php +/** + * Table Definition for profile + */ +require_once 'DB/DataObject.php'; + +class Profile extends DB_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'profile'; // table name + public $id; // int(4) primary_key not_null + public $nickname; // varchar(64) not_null + public $fullname; // varchar(255) + public $profileurl; // varchar(255) + public $homepage; // varchar(255) + public $bio; // varchar(140) + public $location; // varchar(255) + public $created; // datetime() not_null + public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Profile',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/classes/Remote_profile.php b/classes/Remote_profile.php new file mode 100644 index 0000000000..6914bc2fbd --- /dev/null +++ b/classes/Remote_profile.php @@ -0,0 +1,23 @@ +<?php +/** + * Table Definition for remote_profile + */ +require_once 'DB/DataObject.php'; + +class Remote_profile extends DB_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'remote_profile'; // table name + public $id; // int(4) primary_key not_null + public $url; // varchar(255) unique_key + public $created; // datetime() not_null + public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Remote_profile',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/classes/Subscription.php b/classes/Subscription.php new file mode 100644 index 0000000000..93b46b6f88 --- /dev/null +++ b/classes/Subscription.php @@ -0,0 +1,24 @@ +<?php +/** + * Table Definition for subscription + */ +require_once 'DB/DataObject.php'; + +class Subscription extends DB_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'subscription'; // table name + public $subscriber; // int(4) primary_key not_null + public $subscribed; // int(4) primary_key not_null + public $token; // varchar(255) + public $created; // datetime() not_null + public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Subscription',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/classes/User.php b/classes/User.php new file mode 100644 index 0000000000..4ed6003dcd --- /dev/null +++ b/classes/User.php @@ -0,0 +1,24 @@ +<?php +/** + * Table Definition for user + */ +require_once 'DB/DataObject.php'; + +class User extends DB_DataObject +{ + ###START_AUTOCODE + /* the code below is auto generated do not remove the above tag */ + + public $__table = 'user'; // table name + public $id; // int(4) primary_key not_null + public $password; // varchar(255) + public $email; // varchar(255) unique_key + public $created; // datetime() not_null + public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP + + /* Static get */ + function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('User',$k,$v); } + + /* the code above is auto generated do not remove the tag below */ + ###END_AUTOCODE +} diff --git a/classes/profile.php b/classes/profile.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/classes/remote_profile.php b/classes/remote_profile.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/classes/stoica.ini b/classes/stoica.ini new file mode 100644 index 0000000000..52686bcb56 --- /dev/null +++ b/classes/stoica.ini @@ -0,0 +1,58 @@ + +[notice] +id = 129 +profile_id = 129 +content = 2 +rendered = 2 +url = 2 +created = 142 +modified = 384 + +[notice__keys] +id = N + +[profile] +id = 129 +nickname = 130 +fullname = 2 +profileurl = 2 +homepage = 2 +bio = 2 +location = 2 +created = 142 +modified = 384 + +[profile__keys] +id = N + +[remote_profile] +id = 129 +url = 2 +created = 142 +modified = 384 + +[remote_profile__keys] +id = K +url = U + +[subscription] +subscriber = 129 +subscribed = 129 +token = 2 +created = 142 +modified = 384 + +[subscription__keys] +subscriber = K +subscribed = K + +[user] +id = 129 +password = 2 +email = 2 +created = 142 +modified = 384 + +[user__keys] +id = K +email = U diff --git a/classes/update.php b/classes/update.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/classes/user.php b/classes/user.php deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/dataobject.ini b/dataobject.ini new file mode 100644 index 0000000000..b2c0793fa6 --- /dev/null +++ b/dataobject.ini @@ -0,0 +1,9 @@ +[DB_DataObject] + +database = mysql://root:@localhost/stoica +schema_location = /home/evan/code/stoica/classes +class_location = /home/evan/code/stoica/classes +require_prefix = classes/ +class_prefix = +db_driver = MDB2 #Use this if you wish to use MDB2 as the driver +quote_identifiers = 0