本文整理汇总了PHP中Entity::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::__construct方法的具体用法?PHP Entity::__construct怎么用?PHP Entity::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($markup)
{
parent::__construct("");
$this->markup = $markup;
$this->validator(NULL);
// Can't really validate this.
}
示例2: __construct
public function __construct($database, $name)
{
parent::__construct($database, $name);
$this->setPresentation("n_sedie");
$this->addField("n_sedie", INT, 11, MANDATORY);
$this->addField("stato", VARCHAR, 1);
}
示例3: basename
/**
* @param Entity $entity_1
* @param Entity $entity_2
* @param string $name
* @property $name nome della tabella sul db
* @param null $roleName1
* @param null $roleName2
*/
function __construct($entity_1, $entity_2, $name = "", $roleName1 = null, $roleName2 = null)
{
$this->entity_1 = $entity_1;
$this->entity_2 = $entity_2;
if (!$this->entity_1->name) {
echo Message::getInstance()->getMessage(MSG_ERROR_UNKNOWN_ENTITY) . " (" . basename(__FILE__) . ":" . __LINE__ . ")";
exit;
}
if (isset($roleName1)) {
$this->roleName1 = $roleName1;
} else {
$this->roleName1 = $this->entity_1->fields[0]->name . "_" . $this->entity_1->entityName;
}
if (isset($roleName2)) {
$this->roleName2 = $roleName2;
} else {
$this->roleName2 = $this->entity_2->fields[0]->name . "_" . $this->entity_2->entityName;
}
if ($name != "") {
parent::__construct(DB::getInstance(), "{$name}");
} else {
parent::__construct(DB::getInstance(), "{$this->entity_1->entityName}_{$this->entity_2->entityName}");
}
/**
*
*Relations do not have any primary key.
*
*/
$this->addReference($this->entity_1, $this->roleName1);
$this->addReference($this->entity_2, $this->roleName2);
}
示例4: array
function __construct($datas = array())
{
$this->tableName = 'possibilities';
$this->databaseFields = array('idea', 'name', 'code');
parent::__construct($datas);
$this->votes = Database::getAll('votes', array('possibility' => $this->id));
}
示例5: __construct
public function __construct(ClassName $class, Identity $id, Repository $repository, Factory $factory, Alias $alias, RelationshipType $type, RelationshipEdge $startNode, RelationshipEdge $endNode)
{
parent::__construct($class, $id, $repository, $factory, $alias);
$this->type = $type;
$this->startNode = $startNode;
$this->endNode = $endNode;
}
示例6: __construct
public function __construct($aParam = null)
{
parent::__construct($aParam);
if ($sName = $this->GetName()) {
// задается идентификатор виджета
$this->_checkId();
}
if (is_null($this->GetPriority())) {
$this->SetPriority(0);
}
if ($this->GetId()) {
$aCfgData = Config::Get('widget.' . $this->GetId() . '.config');
if ($aCfgData) {
$aCfgData = F::Array_Merge($this->getAllProps(), $aCfgData);
$this->setProps($aCfgData);
}
}
if ($sName && is_null($this->getType())) {
$aTypeData = E::ModuleViewer()->DefineWidgetType($sName, $this->GetDir(), $this->GetPluginId());
if (isset($aTypeData['type'])) {
$this->setType($aTypeData['type']);
if ($aTypeData['type'] == 'template' && !empty($aTypeData['name'])) {
$this->setTemplate($aTypeData['name']);
$this->setName($aTypeData['name']);
}
/* LS-compatible */
if (!$this->getParam('plugin') && $this->getPluginId()) {
$this->setParam('plugin', $this->getPluginId());
}
}
}
}
示例7: __construct
public function __construct($str_SessionID)
{
// Sets entity reference code
$this->entityCode = 'activity';
// Call parent constructor
parent::__construct($str_SessionID);
}
示例8: __construct
public function __construct($id, $name, $location, $beehives)
{
parent::__construct($id);
$this->_name = $name;
$this->_location = $location;
$this->_beehives = $beehives;
}
示例9: __construct
public function __construct()
{
parent::__construct();
$this->fields = array($this->idField, new Field(static::DESCRIPTION_FLD, TextType(), true), new Field(static::HEAD_FLD, StrType(100), true, 'Инициатор', array(Validate::IS_NUMERIC, Validate::IS_NOT_EMPTY)), new Field(static::OWNER_FLD, IntType(), false, 'Инициатор', array(Validate::IS_NUMERIC, Validate::IS_NOT_EMPTY)), new Field(static::TYPE_FLD, IntType(), true, 'Вид события', array(Validate::IS_NUMERIC, Validate::IS_NOT_EMPTY)), new Field(static::CREATION_DATE_FLD, TimestampType(), true, 'Время создания', array(Validate::IS_NOT_EMPTY)), new Field(static::DELETION_DATE_FLD, TimestampType()), new Field(static::UPDATED_DATE_FLD, TimestampType()), new Field(static::DUE_DATE_FLD, TimestampType(), true), new Field(static::PLACE_FLD, IntType(), true, 'Место', array(Validate::IS_NOT_EMPTY)));
$this->dueDateKey = $this->ToPrfxNm(static::DUE_DATE_FLD);
$this->createDateKey = $this->ToPrfxNm(static::CREATION_DATE_FLD);
}
示例10: __construct
public function __construct($input = null)
{
parent::__construct($input);
if (!empty($this->suppressedContact)) {
$this->suppressedContact = new Contact($this->suppressedContact);
}
}
示例11: __construct
public function __construct($database, $name)
{
parent::__construct($database, $name);
$this->setPresentation("name");
$this->addField("name", VARCHAR, 50);
$this->addField("description", TEXT);
}
示例12: __construct
/**
* Определяем дополнительные правила валидации
*
* @param array
*/
public function __construct($aParam = false)
{
if (Config::Get('module.user.captcha_use_registration')) {
$this->aValidateRules[] = array('captcha', 'captcha', 'on' => array('registration'));
}
parent::__construct($aParam);
}
示例13: __construct
public function __construct(\WebPay\WebPay $client, array $data)
{
if (array_key_exists('data', $data) && !empty($data['data'])) {
$data['data'] = new EventData($client, $data['data']);
}
parent::__construct($client, $data);
}
示例14: __construct
public function __construct()
{
$this->type = "User";
$this->url = $this->getURL();
$this->avatar = $this->icon();
parent::__construct();
}
示例15: __construct
public function __construct($database, $name, $owner = "")
{
parent::__construct($database, $name, WITH_OWNER);
$this->addField("filename", VARCHAR, 255, MANDATORY);
$this->addField("size", INT, 5);
$this->addField("filetype", VARCHAR, 255, MANDATORY);
}