本文整理汇总了PHP中SimpleORMap类的典型用法代码示例。如果您正苦于以下问题:PHP SimpleORMap类的具体用法?PHP SimpleORMap怎么用?PHP SimpleORMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SimpleORMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: tearDown
function tearDown()
{
SimpleORMap::expireTableScheme();
Config::set(null);
StudipCacheFactory::setConfig(null);
$GLOBALS['CACHING_ENABLE'] = false;
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:CronjobScheduleTest.php
示例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();
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:156_tic_5204_add_datafield_type.php
示例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();
}
开发者ID:ratbird,项目名称:hope,代码行数:8,代码来源:86_step_228_raumanfragen.php
示例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();
}
}
开发者ID:studip,项目名称:PluginMarket,代码行数:9,代码来源:04_add_rating_to_database.php
示例5: down
public function down()
{
$db = DBManager::get();
$db->exec("ALTER TABLE scm CHANGE tab_name tab_name varchar(20) NOT NULL DEFAULT 'Info',\n CHANGE content content text");
$db->exec("ALTER TABLE user_info CHANGE lebenslauf lebenslauf text,\n CHANGE publi publi text NOT NULL");
$db->exec("ALTER TABLE wiki CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT '',\n CHANGE body body text");
$db->exec("ALTER TABLE wiki_links CHANGE from_keyword from_keyword char(128) BINARY NOT NULL DEFAULT '',\n CHANGE to_keyword to_keyword char(128) BINARY NOT NULL DEFAULT ''");
$db->exec("ALTER TABLE wiki_locks CHANGE keyword keyword varchar(128) BINARY NOT NULL DEFAULT ''");
SimpleORMap::expireTableScheme();
}
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:181_extend_wiki_size.php
示例6: down
function down()
{
$db = DBManager::get();
$db->exec("ALTER TABLE `lock_rules` CHANGE `permission` `permission` ENUM( 'tutor', 'dozent', 'admin', 'root' ) NOT NULL DEFAULT 'dozent'");
$db->exec("ALTER TABLE `lock_rules` DROP `object_type`");
$db->exec("ALTER TABLE `lock_rules` DROP `user_id`");
$db->exec("ALTER TABLE `user_info` DROP `lock_rule`");
$db->exec("ALTER TABLE `Institute` DROP `lock_rule`");
SimpleORMap::expireTableScheme();
}
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:77_step_00223_lockrules.php
示例7: down
public function down()
{
$query = "ALTER TABLE `seminare`\n DROP COLUMN `is_complete`";
DBManager::get()->exec($query);
SimpleORMap::expireTableScheme();
$query = "DELETE FROM `config` WHERE `field` = :field";
$statement = DBManager::get()->prepare($query);
$statement->bindValue(':field', 'ADMIN_COURSES_SHOW_COMPLETE');
$statement->execute();
}
开发者ID:ratbird,项目名称:hope,代码行数:10,代码来源:180_add_seminar_is_complete_status.php
示例8: __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);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:DocFileTypeForbidden.class.php
示例9: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:ArchivedCourseMember.class.php
示例10: __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);
}
开发者ID:anantace,项目名称:SeminarTabs,代码行数:36,代码来源:SeminarTab.class.php
示例11: delete
function delete()
{
$old_assign_object = new AssignObject($this->id);
$ret = parent::delete();
$old_assign_object->delete();
return $ret;
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:ResourceAssignment.class.php
示例12: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:ArchivedCourse.class.php
示例13: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:QuestionnaireAnswer.php
示例14: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:7,代码来源:Questionnaire.php
示例15: __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');
}
}
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:DirectoryEntry.php
示例16: store
public function store()
{
if (!$this['public_key']) {
$this->createKeys();
}
return parent::store();
}
开发者ID:Krassmus,项目名称:LehrMarktplatz,代码行数:7,代码来源:LernmarktplatzIdentity.php
示例17: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:8,代码来源:Contact.class.php
示例18: 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);
}
开发者ID:ratbird,项目名称:hope,代码行数:8,代码来源:StudipEvaluation.php
示例19:
function __construct($id = null)
{
if (version_compare($GLOBALS['SOFTWARE_VERSION'], "3.2", "<")) {
$this->registerCallback('before_store', 'cbSerializeData');
$this->registerCallback('after_store after_initialize', 'cbUnserializeData');
}
parent::__construct($id);
}
开发者ID:Krassmus,项目名称:Fleximport,代码行数:8,代码来源:FleximportTable.php
示例20: delete
/**
* Deletes the asset.
*
* @return int indicating how many rows were deleted
*/
public function delete()
{
$filename = $this->getFilepath();
if (file_exists($filename)) {
unlink($filename);
}
return parent::delete();
}
开发者ID:ratbird,项目名称:hope,代码行数:13,代码来源:PluginAsset.php
注:本文中的SimpleORMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论