Contains the organization

Handles saving of the user definition config

package Gems
subpackage Model
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.5
inherited_from \Gems_Model_JoinModel

 Methods

Copy from \Zend_Translate_Adapter

_(string $text, string|\Zend_Locale $locale = null) : string
Inherited

Translates the given string returns the translation

Parameters

$text

string

Translation string

$locale

string\Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

Constructor

__construct(array|mixed $styles = array()
inherited_from \Gems_Model_JoinModel::__construct()

Parameters

$styles

arraymixed

Create a model that joins two or more tables

__construct(string $name, string $startTable, string $fieldPrefix = null, mixed $saveable = null
Inherited

Parameters

$name

string

A name for the model

$startTable

string

The base table for the model

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Add a table to the model with a left join

addLeftTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Add a table to the model with a right join

addRightTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Add a table to the model with an inner join

addTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

This function is no needed if the classes are setup correctly

Set those settings needed for the browse display

applyBrowseSettings() : \Gems_Model_OrganizationModel

Returns

\Gems_Model_OrganizationModel

Set those settings needed for the detailed display

applyDetailSettings() : \Gems_Model_OrganizationModel

Returns

\Gems_Model_OrganizationModel

Set those values needed for editing

applyEditSettings() : \Gems_Model_OrganizationModel

Returns

\Gems_Model_OrganizationModel

Helper function to get the templates for mails

getPasswordTemplatesFor(string|array $for) : array

Parameters

$for

stringarray

the template types to get

Returns

array

Copy from \Zend_Translate_Adapter

plural(string $singular, string $plural, integer $number, string|\Zend_Locale $locale = null) : string
Inherited

Translates the given string using plural notations Returns the translated string

see

Parameters

$singular

string

Singular translation string

$plural

string

Plural translation string

$number

integer

Number for detecting the correct plural

$locale

string\Zend_Locale

(Optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

Helper function that procesess the raw data after a load.

processAfterLoad(mixed $data, boolean $new = false, boolean $isPostData = false) : array
see

Parameters

$data

mixed

Nested array or \Traversable containing rows or iterator

$new

boolean

True when it is a new item

$isPostData

boolean

With post data, unselected multiOptions values are not set so should be added

Returns

arrayor \Traversable Nested

Save a single model item.

save(array $newValues, array $filter = null, array $saveTables = null) : array

Makes sure the password is saved too using the userclass

Parameters

$newValues

array

The values to store for a single model item.

$filter

array

If the filter contains old key values these are used to decide on update versus insert.

$saveTables

array

Optional array containing the table names to save, otherwise the tables set to save at model level will be saved.

Returns

arrayThe values as they are after saving (they may change).

setTableSaveable()

setTableSaveable(string $table_name, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table_name

string

Does not test for existence

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

_checkSaveable()

_checkSaveable(mixed $saveable, string $fieldPrefix) : mixed
Inherited

Parameters

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

Returns

mixedThe saveable setting to use

Function that checks the setup of this class/traight

initTranslateable() 
Inherited

This function is not needed if the variables have been defined correctly in the source for this object and theose variables have been applied.

return @void

 Properties

 

$_styles

$_styles : array

Default

 

$loader

$loader : \Gems_Loader

Default

 

$project

$project : \Gems_Project_ProjectSettings

Default

 

$translate

$translate : \Zend_Translate

Default

 

$translateAdapter

$translateAdapter : \Zend_Translate_Adapter

Default

 

$util

$util : \Gems_Util

Default