Little fix in ForeignKeyField
This commit is contained in:
parent
a37eb49b35
commit
8bd5472e73
1 changed files with 8 additions and 7 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace PhangoApp\PhaModels\CoreFields;
|
namespace PhangoApp\PhaModels\CoreFields;
|
||||||
use PhangoApp\PhaI18n\I18n;
|
use PhangoApp\PhaI18n\I18n;
|
||||||
|
use PhangoApp\PhaModels\Webmodel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ForeignKeyfield is a relantioship between two models...
|
* ForeignKeyfield is a relantioship between two models...
|
||||||
|
|
@ -38,7 +39,7 @@ class ForeignKeyField extends IntegerField{
|
||||||
$this->default_id=$default;
|
$this->default_id=$default;
|
||||||
$this->quot_open='';
|
$this->quot_open='';
|
||||||
$this->quot_close='';
|
$this->quot_close='';
|
||||||
$this->protected=1;
|
$this->protected=0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +72,7 @@ class ForeignKeyField extends IntegerField{
|
||||||
if(!isset($this->related_model))
|
if(!isset($this->related_model))
|
||||||
{
|
{
|
||||||
|
|
||||||
load_model($this->container_model);
|
Webmodel::load_model($this->container_model);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -133,15 +134,15 @@ class ForeignKeyField extends IntegerField{
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
load_libraries(array('forms/selectmodelform'));
|
//load_libraries(array('forms/selectmodelform'));
|
||||||
|
|
||||||
//SelectModelForm($name, $class, $value, $model_name, $identifier_field, $where='')
|
//SelectModelForm($name, $class, $value, $model_name, $identifier_field, $where='')
|
||||||
|
|
||||||
//Prepare parameters for selectmodelform
|
//Prepare parameters for selectmodelform
|
||||||
|
|
||||||
if(isset($this->name_component) && $this->name_field_to_field!='' && $this->name_model!='' && count(PhangoVar::$model[$this->name_model]->forms)>0)
|
if(isset($this->name_component) && $this->name_field_to_field!='' && $this->name_model!='' && count(Webmodel::$model[$this->name_model]->forms)>0)
|
||||||
{
|
{
|
||||||
PhangoVar::$model[$this->name_model]->forms[$this->name_component]->form='SelectModelForm';
|
Webmodel::$model[$this->name_model]->forms[$this->name_component]->form='PhangoApp\PhaModels\Forms\SelectModelForm';
|
||||||
|
|
||||||
return array($this->name_component, '', '', $this->related_model, $this->name_field_to_field, '');
|
return array($this->name_component, '', '', $this->related_model, $this->name_field_to_field, '');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue