xuServer  4.2
xuServer est un Framework ORM écrit en PHP pour des bases de données MySQL.
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
xsProperty Class Reference
Inheritance diagram for xsProperty:
xsClass xsComponent xsModel xsConcept

Public Member Functions

 __toString ()
 
 __construct (&$parent, $row)
 
 isTitle ($reset=true)
 
 type ($type="text")
 
 comment ($val="")
 
 dropdown ($val=true)
 
 hidden ()
 
 masked ($val=true)
 
 unset ()
 
 check ($val="")
 
 valid ()
 
 invalid ()
 
 disabled ($v=true)
 
 readonly ($val=true)
 
 required ($val=true)
 
 select ($arr)
 
 val ($value="__nothing__", $checkTitle=true)
 
 img_src ()
 
 attr ($name, $value="")
 
 _input ()
 
 _form_group ()
 
 _th ()
 
 _td ($row="")
 
 _tdLink ($caption, $id, $table)
 
- Public Member Functions inherited from xsClass
 __construct ()
 
 __invoke ($sql="")
 
 __call ($funcName, $arguments)
 
 __toString ()
 
 val ($arr="_POST")
 
 upload ()
 
 create ($input="")
 create an instance of the current object in database More...
 
 read ()
 
 update ($input="", $value="")
 
 delete ()
 
 copy ()
 
 find ($criteria="__NOTHING__")
 
 each ($pfunc)
 
- Public Member Functions inherited from xsComponent
 addButton ($name="name", $value="", $label="__label", $CRUD="1111")
 
 addMethod ($name="name", $label="label", $container="xs-fn-footer")
 
 _form ($method="")
 builds and returns the html code for object formular More...
 
 _formCreate ()
 
 _formRead ()
 
 _formUpdate ()
 
 _formDelete ()
 
 _logo ($height="35")
 
 _icon ()
 
 _list_group_item ()
 
 _thumbnail ()
 
 _table ($sql="")
 
- Public Member Functions inherited from xsModel
 init ()
 
 load ($id="")
 
 build ($mci="", $debug=false)
 
 sql ($criteria="__NOTHING__")
 
 sql_create ()
 
 sql_read ()
 
 sql_update ()
 
 sql_delete ()
 
 sql_copy ()
 
 sql_each ()
 
 sql_stats ()
 
 sql_search ($term="")
 
 stats ($pFunc="")
 
 count ()
 
 sum ()
 
 min ()
 
 max ()
 
 avg ()
 
 percent ()
 
 every ()
 
 any ()
 
 CRUD ($CRUD="")
 
- Public Member Functions inherited from xsConcept
 mciparse ($string="")
 this method parses the given string parameter to determine the module name the concept name and the id of the object More...
 
 privilege ($key="")
 
 foldername ($autocreate=false)
 
 design_readclass ()
 
 design_constructor ()
 

Data Fields

 $parent =""
 pointer to parent xsClass More...
 
 $tempStr =""
 temp string for any use More...
 
 $name =""
 Database field name for given property. More...
 
 $label =""
 Database field short description (parsing comments) More...
 
 $db_type ="INT"
 Database property type (int, float, text, blob ...) More...
 
 $db_typelen ="11"
 Database property length. More...
 
 $type ="text"
 property data type More...
 
 $module =""
 if xsProperty::type is "fk" this property stores module of the related object module+"_"+concept = mci More...
 
 $concept =""
 if xsProperty::type is "fk" this property stores the concept of the related object More...
 
 $is_valid = ""
 boolean used to check if the xsProperty::value is valid according to its type (will change the class of form input) More...
 
 $is_readonly = false
 
 $is_disabled =false
 
 $is_required =false
 
 $comment =""
 
 $dropdown =""
 
 $fk_table =""
 stores the xsClass::db_table name an "fk type" properties is pointing to example : user has property "id_profile" with type fk. property points to fk_table "profiles" More...
 
 $fk_title =""
 stores the xsClass::title of the instance stored in a "fk type" property example object user : property "id_profile" with value 2, fk_title is "administrator" More...
 
 $is_title =false
 does the property stores the title value of the object More...
 
- Data Fields inherited from xsClass
 $properties =array()
 array of xsProperties More...
 
 $methods =array()
 array of xsMethods (end user public methods) More...
 
 $collections =array()
 array of xsCollections More...
 
 $uploading =false
 boolean that determines if a file is uploaded with the posted _form More...
 
 $_selectionType = "__NOTHING__"
 
- Data Fields inherited from xsModel
 $db_table ="xam_user"
 name of the table in Database that stores class instances More...
 
 $db_index =""
 name of table field that stores the auto_increment primary key More...
 
 $db_title =""
 name of table field that stores the class title if not specified before using xsClass::load(), the second table column is used More...
 
 $is_built =false
 flag to test if object has been build (metadata, methods ...) More...
 
 $title ="__notitle__"
 this property stores the common name given to an instance of the class More...
 
 $name ="__notitle__"
 this property stores : More...
 
 $can_create =1
 can user create concept instance More...
 
 $can_read =1
 can user read concept instance More...
 
 $can_update =1
 can user update concept instance More...
 
 $can_delete =1
 can user delete concept instance More...
 
 $can_search =1
 can user search concept instance More...
 
 $sql_load_alias =Array()
 
- Data Fields inherited from xsConcept
 $mci =""
 identification of the class concatenation of module_concept_dbid More...
 
 $module ="xam"
 name of the module that deals with the object held by xsClass (convention : word before the first "_" in tablename) More...
 
 $concept ="user"
 name of the class beeing held by xsClass. concept is the name of the php class that extends metaclass xsClass More...
 
 $includeFile =""
 path to the business class file if exists More...
 
 $logoPath =""
 path to the logo of current class More...
 
 $privilegeKey =""
 privilege name defined on child classes More...
 
 $db_id =0
 unique identifyer of primary key, instance number of the class More...
 

Private Member Functions

 FKTable ($fk_table="")
 

Private Attributes

 $value
 stores the property value access or modify this private attribute using More...
 

Additional Inherited Members

- Protected Member Functions inherited from xsComponent
 addProperty ($name="name", $value="", $label="__label", $CRUD="1111")
 
 addCollection ($table, $fk_index)
 
 onMetadata ()
 
 onBeforeMetadata ()
 
 onBuildMethods ()
 
 onInstance ()
 
 onBeforeInstance ()
 
 onInstanceFail ()
 
 onBeforeUpdate ()
 
 onUpdate ()
 
 _fieldset ($ajax=true)
 
 _iconCRUD ($crud="", $class="success")
 
- Protected Member Functions inherited from xsModel
 instance ($stmt, $collections="__NONE__")
 
 build_sql ()
 
 build_collections ($criteria="__NOTHING__")
 
- Protected Member Functions inherited from xsConcept
 mciSet ()
 
- Protected Attributes inherited from xsModel
 $sql_statement =""
 last build sql statement : More...
 
 $sql_statement_create =""
 create an instance in db More...
 
 $sql_statement_read =""
 read an instance in db More...
 
 $sql_statement_update =""
 update an instance in db More...
 
 $sql_statement_delete =""
 delete an instance in db More...
 
 $sql_statement_each =""
 sql each stand for selecting objects in db More...
 
 $sql_statement_stats =""
 

Constructor & Destructor Documentation

◆ __construct()

__construct ( $parent,
  $row 
)

Member Function Documentation

◆ __toString()

__toString ( )

return property value when invoking property as a string

Returns
string

◆ _form_group()

_form_group ( )

◆ _input()

_input ( )

◆ _td()

_td (   $row = "")

retourne la propriété sous la forme d'une table>th

Parameters
array$row,tableauassociatif contenant les valeurs des propriétés (xsClass non instanciée)
See also
xsClass::$sql_statement
Returns
string

◆ _tdLink()

_tdLink (   $caption,
  $id,
  $table 
)

retourne la propriété sous la forme d'un lien a href

Parameters
StringCaption
Returns
string

◆ _th()

_th ( )

retourne la propriété sous la forme d'une table>th

See also
xsClass->_table
Returns
string

◆ attr()

attr (   $name,
  $value = "" 
)

◆ check()

check (   $val = "")

Check or set validity of property value according to its type

Parameters
mixted$valEmpty parameter given : check validity and change xsProperty::$is_valid

Boolean given : set xsProperty::$is_valid to given value Function given : check validity, change xsProperty::$is_valid and apply a the function to xsProperty

Returns
xsClass

◆ comment()

comment (   $val = "")

Set property comment span

Parameters
string$val
Returns
xsProperty

◆ disabled()

disabled (   $v = true)

◆ dropdown()

dropdown (   $val = true)

◆ FKTable()

FKTable (   $fk_table = "")
private

◆ hidden()

hidden ( )

hide input

Returns
xsProperty

◆ img_src()

img_src ( )

◆ invalid()

invalid ( )

◆ isTitle()

isTitle (   $reset = true)

set the current property to be $parent title use within xsClass::onMedatata()

Parameters
boolean$resetreset last title-property
Returns
xsProperty

◆ masked()

masked (   $val = true)

prevent from beeing read clientside (form inputs, table cells ...)

Returns
xsProperty

◆ readonly()

readonly (   $val = true)

◆ required()

required (   $val = true)

◆ select()

select (   $arr)

◆ type()

type (   $type = "text")

Change xsProperty::type

Parameters
string$type
Returns
xsProperty

◆ unset()

unset ( )

Unset the property from xsClass current instance

Returns
xsClass

◆ val()

val (   $value = "__nothing__",
  $checkTitle = true 
)

set or retrieve property value. when setting value for a property, the method returns the parent object. so that it is possible to "chain object property changes". ex : $user->§country->val("france")->§firstname->val("john")

Parameters
String$valuevalue to set
$checkTitlebool determines if the Title value should be checked,
Returns
string|xsClass

◆ valid()

valid ( )

Field Documentation

◆ $comment

$comment =""

html comment on field, placed in help div belox form

◆ $concept

$concept =""

if xsProperty::type is "fk" this property stores the concept of the related object

◆ $db_type

$db_type ="INT"

Database property type (int, float, text, blob ...)

◆ $db_typelen

$db_typelen ="11"

Database property length.

◆ $dropdown

$dropdown =""

determines if a method type should be placed into the dropdown menu (

See also
xsClass.js)

◆ $fk_table

$fk_table =""

stores the xsClass::db_table name an "fk type" properties is pointing to example : user has property "id_profile" with type fk. property points to fk_table "profiles"

◆ $fk_title

$fk_title =""

stores the xsClass::title of the instance stored in a "fk type" property example object user : property "id_profile" with value 2, fk_title is "administrator"

◆ $is_disabled

$is_disabled =false

◆ $is_readonly

$is_readonly = false
  • boolean : used to set xsProperty::value to readonly

◆ $is_required

$is_required =false

◆ $is_title

$is_title =false

does the property stores the title value of the object

◆ $is_valid

$is_valid = ""

boolean used to check if the xsProperty::value is valid according to its type (will change the class of form input)

-- empty string : validity is not checked

◆ $label

$label =""

Database field short description (parsing comments)

◆ $module

$module =""

if xsProperty::type is "fk" this property stores module of the related object module+"_"+concept = mci

◆ $name

$name =""

Database field name for given property.

◆ $parent

$parent =""

pointer to parent xsClass

◆ $tempStr

$tempStr =""

temp string for any use

Deprecated:

◆ $type

$type ="text"

property data type

◆ $value

$value
private

stores the property value access or modify this private attribute using

See also
xsProperty::val()