本文整理汇总了PHP中DBObject::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP DBObject::__construct方法的具体用法?PHP DBObject::__construct怎么用?PHP DBObject::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObject
的用法示例。
在下文中一共展示了DBObject::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Data constructor
*
* @param int $id Optional - if set gets data from PID = $id
* @param string $class Option - if set then sets className directly
*/
public function __construct($id = NULL, $class = NULL)
{
if ($class) {
$this->setClassName($class);
}
parent::__construct($id);
}
示例2: __construct
public function __construct($table_name, $columns, $id = null)
{
if (!is_array(ORMObject::$_data)) {
ORMObject::$_data = array();
}
parent::__construct($table_name, $columns, $id);
}
示例3: Exception
/**
* Constructor
* @param {string} Name for this object
* @param {integer} $manga Manga ID
* @throws Exception when
* - cannot contact database
* - invalid manga ID
*/
function __construct($file, $manga)
{
parent::__construct($file);
if ($manga <= 0) {
$this->errormsg = "Resultados::Construct invalid Manga ID: {$manga}";
throw new Exception($this->errormsg);
}
$this->manga = $this->__getArray("Mangas", $manga);
if (!is_array($this->manga)) {
$this->errormsg = "OrdenSalida::construct(): Cannot get info on manga:{$manga}";
throw new Exception($this->errormsg);
}
$this->jornada = $this->__getArray("Jornadas", $this->manga['Jornada']);
if (!is_array($this->jornada)) {
$this->errormsg = "OrdenSalida::construct(): Cannot get jornada info on jornada:{$this->manga['Jornada']} manga:{$manga}";
throw new Exception($this->errormsg);
}
$this->prueba = $this->__getArray("Pruebas", $this->jornada['Prueba']);
if (!is_array($this->prueba)) {
$this->errormsg = "OrdenSalida::construct(): Cannot get prueba info on prueba:{$this->jornada['Prueba']} jornada:{$this->manga['Jornada']} manga:{$manga}";
throw new Exception($this->errormsg);
}
$this->federation = Federations::getFederation(intval($this->prueba['RSCE']));
if ($this->federation == null) {
$this->errormsg = "OrdenSalida::construct(): Cannot get federation info on prueba:{$this->jornada['Prueba']} jornada:{$this->manga['Jornada']} manga:{$manga}";
throw new Exception($this->errormsg);
}
}
示例4: __construct
public function __construct($id = false)
{
if (empty($id)) {
$this->Created = time();
$this->Modified = time();
}
parent::__construct($id);
}
示例5: __construct
public function __construct($id = '')
{
parent::__construct('tags', array('name'), '');
$this->select($id, 'name');
if ($this->id == '') {
$this->name = $id;
$this->insert();
}
}
示例6: __construct
public function __construct($init = null, $key = 0)
{
parent::__construct();
$this->_objType = 'categories_category';
$this->_objPath = 'category';
$this->_objPermissionFilter[] = array('component_left' => 'ZikulaCategoriesModule', 'component_middle' => '', 'component_right' => '', 'instance_left' => 'id', 'instance_middle' => 'ipath', 'instance_right' => 'path', 'level' => ACCESS_READ);
$this->_objValidation['name'] = array('name', true, 'noop', '', __('Error! You did not enter a name.'), '');
$this->_init($init, $key);
}
示例7: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'persist_users';
$meta['name'] = 'PersistUser';
$meta['fields'] = array('id' => 'primarykey', 'user_id' => 'integer', 'random' => 'integer', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例8: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'components';
$meta['name'] = 'Component';
$meta['fields'] = array('id' => 'primarykey', 'name' => 'string', 'filename' => array('type' => 'string', 'string_size' => 1024), 'options' => 'text', 'active' => 'boolean', 'modified' => 'lastmodified', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例9: array
function __construct($meta = array(), array $options = array())
{
$fields = $meta['fields'];
$fields['mime_type'] = array_key_exists('mime_type', $fields) ? $fields['mime_type'] : 'string';
$fields['from_db'] = array_key_exists('from_db', $fields) ? $fields['from_db'] : 'boolean';
$fields['content'] = array_key_exists('content', $fields) ? $fields['content'] : 'long_blob';
$fields['meta_info'] = array_key_exists('meta_info', $fields) ? $fields['meta_info'] : 'serialized';
$meta['fields'] = $fields;
return parent::__construct($meta, $options);
}
示例10: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'b_e_filters';
$meta['name'] = 'BEFilter';
$meta['fields'] = array('id' => 'primarykey', 'name' => 'string', 'description' => 'text', 'class' => 'string', 'function' => 'string', 'options' => 'string', 'active' => 'boolean', 'modified' => 'lastmodified', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例11: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'themes';
$meta['name'] = 'Theme';
$meta['fields'] = array('id' => 'primarykey', 'name' => 'string', 'description' => 'text', 'screenshot' => 'string (default)', 'path' => 'string', 'active' => 'boolean', 'modified' => 'lastmodified', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例12: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'assignments';
$meta['name'] = 'Assignment';
$meta['fields'] = array('id' => 'primarykey', 'access_type' => 'string', 'access_id' => 'integer', 'role_id' => 'integer', 'active' => 'boolean', 'modified' => 'lastmodified', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例13: Exception
/**
* Constructor
* @param {string} $file caller for this object
* @param {integer} $prueba Prueba ID for these jornadas
* @throws Exception if cannot contact database
*/
function __construct($file, $prueba)
{
parent::__construct($file);
if ($prueba < 0) {
$this->errormsg = "{$file}::construct() invalid prueba ID";
throw new Exception($this->errormsg);
}
$this->prueba = $prueba;
$this->jueces = array("1" => "-- Sin asignar --");
}
示例14: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'backend_files';
$meta['name'] = 'BackendFile';
$meta['fields'] = array('id' => 'primarykey', 'name' => array('type' => 'string', 'string_size' => 255), 'file' => array('type' => 'string', 'string_size' => 1024), 'version' => array('type' => 'string', 'string_size' => 10), 'dependencies' => 'text', 'active' => 'boolean', 'modified' => 'lastmodified', 'added' => 'dateadded');
return parent::__construct($meta, $options);
}
示例15: array
function __construct($meta = array(), array $options = array())
{
if (!is_array($meta) && is_numeric($meta)) {
$meta = array('id' => $meta);
}
$meta['table'] = 'backend_errors';
$meta['name'] = 'BackendErrors';
$meta['fields'] = array('id' => 'primarykey', 'user_id' => 'current_user', 'mode' => array('type' => 'string', 'string_size' => 255), 'request' => 'current_request', 'query' => 'current_query', 'number' => 'number', 'string' => 'large_string', 'file' => 'string', 'line' => 'number', 'context' => 'string', 'stacktrace' => 'text', 'added' => 'lastmodified');
return parent::__construct($meta, $options);
}