本文整理汇总了PHP中AppModel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP AppModel::__construct方法的具体用法?PHP AppModel::__construct怎么用?PHP AppModel::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppModel
的用法示例。
在下文中一共展示了AppModel::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($id = false, $table = null, $ds = null)
{
$this->actsAs['Uploader.FileValidation']['file_name']['extension']['value'] = Configure::read('Rule.FileExtensions');
$this->actsAs['Uploader.FileValidation']['file_name']['filesize']['value'] = Configure::read('Rule.MaxFileSize') * 1024 * 1024;
$this->actsAs['Uploader.FileValidation']['file_name']['filesize']['message'] = 'Dosya çok büyük; maximum boyut ' . Configure::read('Rule.MaxFileSize') . 'MB';
parent::__construct($id, $table, $ds);
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->fix_unaries();
$this->append_plugin_name_to_classes();
$this->set_validation_messages();
}
示例3: __construct
/**
* Constructor, used to tell this model to use the
* database configured for ACL
*/
public function __construct() {
$config = Configure::read('Acl.database');
if (!empty($config)) {
$this->useDbConfig = $config;
}
parent::__construct();
}
示例4: __construct
public function __construct($id = false, $table = null, $ds = null)
{
parent::__construct($id, $table, $ds);
$this->INTERVAL_MIN = Configure::read('login_inspection_interval_min');
$this->ATTEMPT_LIMIT = Configure::read('login_attempt_limit');
$this->LOCKOUT_MIN = Configure::read('login_lockout_min');
}
示例5:
function __construct()
{
parent::__construct();
if (!isset($this->Node)) {
$this->Node = ClassRegistry::init('Node');
}
}
示例6: __construct
/**
* {@inheritdoc}
*/
public function __construct($id = false, $table = null, $ds = null)
{
parent::__construct();
$this->ClopeTransaction = ClassRegistry::init('ClopeClustering.ClopeTransaction');
$this->ClopeCluster = ClassRegistry::init('ClopeClustering.ClopeCluster');
$this->ClopeAttribute = ClassRegistry::init('ClopeClustering.ClopeAttribute');
}
示例7: __construct
/**
* Override the constructor to provide custom model finds
*
* @param mixed $modelId Set this ID for this model on startup, can also be an array of options, see above.
* @param string $table Name of database table to use.
* @param string $datasource DataSource connection name.
*/
public function __construct($modelId = false, $table = null, $datasource = null)
{
parent::__construct($modelId, $table, $datasource);
$this->findMethods['files'] = true;
$this->findMethods['repository'] = true;
$this->findMethods['user'] = true;
}
示例8: __construct
/**
* ItemAvailabilityTimes constructor.
*
* @param array|bool|int|string $id
* @param null|string $table
* @param null|string $ds
*/
public function __construct($id, $table, $ds)
{
parent::__construct($id, $table, $ds);
if (defined('REDIS_ENABLE') && empty($this->Redis)) {
$this->Redis = new RedisModel();
}
}
示例9: __construct
public function __construct($title, $user_id, $date_created = NULL)
{
parent::__construct($date_created);
$this->fields["title"] = array($title, "VARCHAR(512)");
$this->fields["user_id"] = array($user_id, "INT(11), FOREIGN KEY(user_id) REFERENCES user_models(id) ON DELETE CASCADE");
parent::construct_if_not_exists();
}
示例10:
function __construct($id = false, $table = null, $ds = null)
{
if (Configure::read() == 0) {
$this->cakeError('error500');
}
parent::__construct($id, $table, $ds);
}
示例11:
function __construct()
{
parent::__construct();
$this->ds = ldap_connect($this->host, $this->port);
ldap_set_option($this->ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_bind($this->ds, $this->user, $this->pass);
}
示例12:
function __construct()
{
$viewPaths = Configure::read('viewPaths');
$this->path = $viewPaths[0] . 'themed' . DS;
$this->data['Theme'] = null;
parent::__construct();
}
示例13: __construct
public function __construct($id = false, $table = null, $ds = null)
{
parent::__construct($id, $table, $ds);
//$this->virtualFields = Set::merge($this->virtualFields, array(
// 'distribution' => 'IF (Event.private=true AND Event.cluster=false, "Your organization only", IF (Event.private=true AND Event.cluster=true, "This server-only", IF (Event.private=false AND Event.cluster=true, "This Community-only", IF (Event.communitie=true, "Connected communities" , "All communities"))))',
// ));
}
示例14: __construct
/**
* Class constructor
*
* @param bool|int|string|array $id Set this ID for this model on startup.
* @param string $table Name of database table to use.
* @param string $ds DataSource connection name.
*/
public function __construct($id = false, $table = null, $ds = null)
{
if (is_array($id)) {
$alias = Hash::get($id, 'alias') ?: (Hash::get($id, 'table') ?: $this->alias);
$id['alias'] = Inflector::singularize(preg_replace('/Table$/', '', $alias));
$this->name = $this->alias = $this->alias($id['alias']);
$schema = Hash::get($id, 'schema');
if ($schema !== null) {
$this->_schema = $schema;
}
}
if ($table === null) {
if ($this->name === null) {
$this->name = isset($name) ? $name : get_class($this);
}
if ($this->alias === null) {
$this->alias = isset($alias) ? $alias : $this->name;
}
$table = Inflector::tableize(preg_replace('/Table$/', '', $this->alias));
}
parent::__construct($id, $table, $ds);
$this->entityClass(Inflector::singularize($this->name) . 'Entity');
$this->initialize([]);
$this->entity(false);
}
示例15: foreach
function __construct($id = false, $table = null, $ds = null)
{
foreach ($this->actsAs['ActivityProvider']['find_options']['joins'] as $index => $join) {
$this->actsAs['ActivityProvider']['find_options']['joins'][$index]['table'] = $this->fullTableName($join['alias']);
}
parent::__construct($id, $table, $ds);
}