本文整理汇总了PHP中SimpleORMap类的典型用法代码示例。如果您正苦于以下问题:PHP SimpleORMap类的具体用法?PHP SimpleORMap怎么用?PHP SimpleORMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleORMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
function tearDown()
{
SimpleORMap::expireTableScheme();
Config::set(null);
StudipCacheFactory::setConfig(null);
$GLOBALS['CACHING_ENABLE'] = false;
}
示例2: up
function up()
{
$db = DbManager::get();
$db->exec("ALTER TABLE `datafields` CHANGE `type` `type` ENUM('bool','textline','textarea','selectbox','date','time','email','phone','radio','combo','link','selectboxmultiple') NOT NULL DEFAULT 'textline'");
$db->exec("ALTER TABLE `datafields` ADD `is_userfilter` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `is_required`");
SimpleORMap::expireTableScheme();
}
示例3: up
function up()
{
$db = DBManager::get();
$db->exec("ALTER TABLE `resources_requests` ADD `metadate_id` VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `termin_id`");
$db->exec("ALTER TABLE `resources_requests` DROP INDEX `closed` , ADD INDEX `closed` ( `closed` , `request_id`, `resource_id` )");
$db->exec("ALTER TABLE `resources_requests` ADD INDEX ( `metadate_id` )");
SimpleORMap::expireTableScheme();
}
示例4: up
public function up()
{
DBManager::get()->exec("\n ALTER TABLE `pluginmarket_plugins`\n ADD `rating` DOUBLE NULL AFTER `language` ;\n ");
SimpleORMap::expireTableScheme();
foreach (MarketPlugin::findBySQL("1=1") as $plugin) {
$plugin['rating'] = $plugin->calculateRating();
$plugin->store();
}
}
示例5: __construct
public function __construct($id = null)
{
$this->db_table = 'doc_filetype_forbidden';
$this->belongs_to['userConfig'] = array('class_name' => 'DocUsergroupConfig', 'foreign_key' => 'usergroup');
$this->belongs_to['filetype'] = array('class_name' => 'DocFiletype', 'foreign_key' => 'dateityp_id');
parent::__construct($id);
}
示例6: configure
protected static function configure($config = array())
{
$config['db_table'] = 'archiv_user';
$config['belongs_to']['user'] = array('class_name' => 'User', 'foreign_key' => 'user_id');
$config['belongs_to']['course'] = array('class_name' => 'ArchivedCourse', 'foreign_key' => 'seminar_id');
parent::configure($config);
}
示例7: __construct
/**
* Give primary key of record as param to fetch
* corresponding record from db if available, if not preset primary key
* with given value. Give null to create new record
*
* @param mixed $id primary key of table
*/
public function __construct($id = null)
{
$this->db_table = 'seminar_tabs';
$this->belongs_to['course'] = array('class_name' => '\\Course', 'foreign_key' => 'seminar_id');
// workaround for Stud.IP ticket:5312
//$options = $this->getRelationOptions('course');
//$options = $this->getRelationOptions('parent');
/**
$this->has_many['children'] = array(
'class_name' => 'Mooc\\DB\\Block',
'assoc_foreign_key' => 'parent_id',
'assoc_func' => 'findByParent_id',
'on_delete' => 'delete',
'on_store' => 'store'
);
$this->registerCallback('before_create', 'ensureSeminarId');
$this->registerCallback('before_create', 'ensurePositionId');
$this->registerCallback('before_store', 'validate');
$this->registerCallback('after_delete', 'destroyFields');
$this->registerCallback('after_delete', 'destroyUserProgress');
$this->registerCallback('after_delete', 'updatePositionsAfterDelete');
$events = words('after_create after_update after_store after_delete');
$this->registerCallback($events, 'callbackToMetrics');
**/
parent::__construct($id);
}
示例8: delete
function delete()
{
$old_assign_object = new AssignObject($this->id);
$ret = parent::delete();
$old_assign_object->delete();
return $ret;
}
示例9: configure
protected static function configure($config = array())
{
$config['db_table'] = 'archiv';
$config['has_many']['members'] = array('class_name' => 'ArchivedCourseMember', 'on_delete' => 'delete', 'on_store' => 'store');
$config['belongs_to']['home_institut'] = array('class_name' => 'Institute', 'foreign_key' => 'heimat_inst_id');
parent::configure($config);
}
示例10: configure
protected static function configure($config = array())
{
$config['db_table'] = 'questionnaire_answers';
$config['belongs_to']['question'] = array('class_name' => 'QuestionnaireQuestion');
$config['serialized_fields']['answerdata'] = "JSONArrayObject";
parent::configure($config);
}
示例11: configure
protected static function configure($config = array())
{
$config['db_table'] = 'questionnaires';
$config['has_many']['questions'] = array('class_name' => 'QuestionnaireQuestion', 'on_delete' => 'delete', 'on_store' => 'store');
$config['has_many']['assignments'] = array('class_name' => 'QuestionnaireAssignment', 'on_delete' => 'delete', 'on_store' => 'store');
parent::configure($config);
}
示例12: __construct
/**
* Initialize a new directory entry object for the given id.
*
* @param string $id directory entry id
* @throws InvalidArgumentException if id of directory entry is invalid
*/
public function __construct($id = null)
{
parent::__construct($id);
if ($id !== null && $this->isNew()) {
throw new InvalidArgumentException('directory entry not found');
}
}
示例13: store
public function store()
{
if (!$this['public_key']) {
$this->createKeys();
}
return parent::store();
}
示例14: configure
protected static function configure($config = array())
{
$config['db_table'] = 'contact';
$config['belongs_to']['owner'] = array('class_name' => 'User', 'foreign_key' => 'owner_id');
$config['belongs_to']['friend'] = array('class_name' => 'User', 'foreign_key' => 'user_id');
$config['has_many']['group_assignments'] = array('class_name' => 'StatusgruppeUser', 'foreign_key' => 'user_id', 'assoc_foreign_key' => 'user_id', 'on_delete' => 'delete', 'on_store' => 'store');
parent::configure($config);
}
示例15: configure
protected static function configure($config = array())
{
$config['db_table'] = 'eval';
$config['belongs_to']['author'] = array('class_name' => 'User', 'foreign_key' => 'author_id');
$config['has_and_belongs_to_many']['participants'] = array('class_name' => 'User', 'thru_table' => 'eval_user');
$config['additional_fields']['enddate'] = true;
parent::configure($config);
}