Documentation - 0.3.0 (beta)

Introduction

As already mentioned in the name of the web framework, forestPHP follows the paradigm of the forest. Each homepage can be considered as a pure tree structure. A complete instance of forestPHP is called a trunk. All reusable core functionality is in the roots. A single web page originates from the trunk as a branch and is optionally assigned to a database table. Each record of this table is a twig, whereby the representation of records can be performed with different leafs. All these terms can be found in the source code of the forestPHP Framework and serve as orientation points in the development.

Installation

After downloading the current version or obtaining a copy from GitHub you can copy the forestPHP-directory in a folder of the web server or upload this.

On the database system MariaDB / MySQL you have to create a new database for the use of forestPHP (e.g. forestphp). In the forestPHP-directory you can find in folder install a SQL-file: forestPHP_Vanilla_SQL_MariaDB.sql. This file contains all SQL-Queries for initial use of forestPHP, which must be executed in the previously created database. Subsequently, forestPHP can be called up and used on the web server.

In file forestPHP.php in Constructor of the class you have to configure the connection to the database, by entering database, user and password:
$o_glob->Base->Add(new forestBase(forestBase::MariaSQL, 'host_ip', 'database', 'db_user', 'db_pw'), 'forestPHPMariaSQLBase');
Make sure that you specify the key of the new connection as the active base gateway: $o_glob->ActiveBase = 'forestPHPMariaSQLBase';
In general, it is possible to create several connections to different databases with forestPHP.

File and Folder Structure

In the forestPHP directory itself is the index.php which calls an instance of forestPHP and has debug-specific settings ready. Furthermore, there are the following directories, which must not be moved or renamed:

  • images
    • In this directory, images can be stored as required, which are mandatory for the web application. In the subdirectory sys_fphp all pictures are stored, which forestPHP itself needs.
  • install
    • As mentioned in the chapter Installation, this directory contains all the SQL files for the initial configuration of a forestPHP database.
  • roots
    • Here are all root files of forestPHP stored, which provide the core functionalities. Inherited core functions from other software projects are stored in the adopted folder. Own php class files should be placed in the custom folder.
  • src
    • This folder contains the css file(forestPHP.css) and the javascript file(forestPHP.js) of forestPHP. Furthermore, other sources such as bootstrap or jQuery, which are included by forestPHP in the header are stored here.
  • temp_files
    • This folder is used to store all sorts of temporary files that the Web application may create or edit.
  • trunk
    • The trunk folder contains the actual content that the web application should display. At the first level are the files initLeaf.php, trunkFootLeaf.php, and trunkHeadLeaf.php. In the subdirectory index lies the indexBranch file, which corresponds to the start page of forestPHP. All other contents are then in subdirectories of index.
  • twigs
    • All Twig files for modeling the database tables are stored in the twigs directory.

Conventions

As with many web frameworks, there are a number of conventions that do not limit development too much programmatically. For the forestPHP framework to work, these conventions must be adhered to. Otherwise it can lead to unforeseen errors and in the worst case even to data loss.


  • The locations of files and their types are as described in the chapter file and folder structure.
  • System tables begin with the prefix sys_fphp_ and must not be changed. All other tables should be prefixed with fphp_. Thus forestPHP tables can also be integrated into a database that are not only intended for the forestPHP Framework.
  • All root files begin with forest in the filename and class name. PHP classes that contain core functionality for the framework must be declared as a class and placed in roots only.
  • All PHP classes in the forestPHP Framework use the trait forestData for using uniform data types. Further information can be found in the chapter data types.
  • The controller of the forestPHP Framework is located in the root file forestBranch.php. All central functions and execution of actions are initiated and executed in the controller.
  • All Twig files for modeling the database tables are stored in the twigs directory. Each twig must be defined as a class and implemented as a base class forestTwig. File names always end with Twig.php.
  • Each branch has its own folder in the trunk directory in relation to its parent branch. The name for the Branch is unique to the entire forestPHP instance and can not be defined more than once. Each branch must be defined as a class and implement forestBranch as its base class. File names always end with Branch.php.
  • A function for an action to a branch must always include the name of the action in lowercase and end with 'Action'. Example: public function readAction() {};
  • For a branch, any number of leaf files can be created as views. The leaf files must be placed in the same directory as the branch file. File names always end with Leaf.php.
  • Global variables are defined and used only in the root file forestGlobals.php. For a general temporary storage, there is the global list Temp in forestGlobals.
  • Central information about the calling branch and use case is in the URL string. For the forestPHP framework, the syntax of the data within the URL string is fixed:
    http://www.example.com/index.php?/index/branch1/branch2/message&create$subject&from/TestMessage&SystemUser
    http://www.example.com/forestPHP index page/branch path/branch&action of branch$parameter names separated with &/parameter values separated with &
    Please use the forestLink class to create links within forestPHP to other Branches & Actions.

Data Types

Variables in PHP can contain any type of data. Working with relational databases this is not always helpful and often leads to conflicts when creating or editing records. To improve this, forestPHP has created its own data type classes which every PHP class must use.


  • forestString for alphanumeric strings
  • forestList for a fixed list of values
  • forestNumericString for numeric values
  • forestInt für integers
  • forestFloat for decimal and floating-point numbers
  • forestBool for boolean states
  • forestArray for PHP arrays
  • forestObject to instantiate any class (class name is set when creating forestObject)

By including use forestData; in a class, properties can be instantiated in the constructor of the class with the data type classes:

						
class foo {
	use forestData;

	private Test;
	
	public function __construct() {
		$this->Test = new forestString;
	}
	
	public function DoSomething() {
		$this->Test->value = 'Hello World!';
		echo $this->Test->value;
		
		$this->Test->value = 123; // will result in an exception
		$this->Test->value = 12.34; // will result in an exception
		$this->Test->value = array(1, 2, 3); // will result in an exception
	}
}

$o_foo = new foo;

$o_foo->Test = 'Hello World!';
echo $o_foo->Test;

$o_foo->Test = 123; // will result in an exception
$o_foo->Test = 12.34; // will result in an exception
$o_foo->Test = array(1, 2, 3); // will result in an exception
						
					

Create new Branch(page)

First, create a new record in the sys_fphp_branch table. This goes e.g. with the following SQL statement:
INSERT INTO `sys_fphp_branch` (`Name`, `ParentBranch`, `Title`, `Navigation`, `NavigationOrder`, `Filename`, `Table`, `StandardView`, `Filter`, `KeepFilter`) VALUES ('test', '1', 'First Test', '1', '1', NULL, NULL, '1', 1, 0);

The name of the branch should contain only lowercase letters and no spaces, as this will also be the folder name of the branch. With ParentBranch you specify which branch of the branch is in the forestPHP tree structure. The simplest case is the Id 1, the root branch of forestPHP. The Title is the name of the branch visible in the web application. Navigation and NavigationOrder indicates whether the branch is to be displayed in the navigation, and in the case of several branches on one lever, where it should be displayed in order. Filename can be used to point to a file on the web server (for example, a download link in the navigation). Table specifies the UUID of the table to which the branch is linked (optional). StandardView specifies whether the branch should be displayed by default in the LIST or DETAIL view (default: LIST). Filter indicates whether filtering is allowed on the displayed records. KeepFilter retains the filter input even if another action or even branch has been selected by the user.

Then, in the trunk directory in subfolder index, create a folder for the branch (in this case, test). Then create the file testBranch.php with the class definition and the integration of forestData.

Within a Branch Actions can be defined. These Actions then correspond to functions or use cases that are explicitly programmed for this Branch. The number of Action s is arbitrary. For reusable Action s, they can be programmed in the forestBranch controller. Optionally, Action s can also be programmed per branch. A function for an Action must always contain the name of the Action in lowercase letters and end with 'Action'. Example: public function readAction() {};

As a default action s, each branch must have implemented the init() and initBranch() functions. In initBranch(), general properties of the branch, such as default view, filters, etc., can be changed. init() is the default action taken when calling Branch; an initial page for the branch.

Example:

						
indexBranch.php

class indexBranch extends forestBranch {
	use forestData;
	
	/* Fields */
	
	/* Properties */
	
	/* Methods */
	
	protected function initBranch() {
		
	}
	
	protected function init() {
		/* generates a landing page with links to other branch children or an empty page */
		$this->GenerateLandingPage();
	}
}
						
					

Create new Twig(table)

For a new Twig, first create a new table in the database. A Twig class is created for the table as a Twig file. Both the name of the table and the name of the file must have the same name. System tables begin with the prefix sys_fphp_ and must not be changed. All other tables should be prefixed with fphp_. All Twig files for modeling the database tables are stored in the twigs directory. Each twig must be defined as a class and implemented as a base class forestTwig. File names always end with Twig.php.

Then, every tablefield with the same name must be listed in the Twig file. In the init function, each data field is assigned a forestPHP data type. Make sure that a forestPHP data type is compatible with the SQL data type.
Example:

						
actionTwig.php

class actionTwig extends forestTwig {
	use forestData;
	
	/* Fields */
	
	private $Id;
	private $BranchId;
	private $Name;
	
	/* Properties */
	
	/* Methods */
	
	protected function init() {
		$this->Id = new forestNumericString(1);
		$this->BranchId = new forestInt;
		$this->Name = new forestString;
		
		/* forestTwig system fields */
		$this->fphp_Table->value = 'sys_fphp_action';
		$this->fphp_Primary->value = array('Id');
		$this->fphp_Unique->value = array('BranchId;Name');
		$this->fphp_SortOrder->value->Add(true, 'Id');
		$this->fphp_Interval->value = 50;
		$this->fphp_View->value = array('Name');
		$this->fphp_FillMapping(get_object_vars($this));
	}
}
						
					
A Twig has different system fields as properties:
  • fphp_Table: exact name of sql table
  • fphp_Primary: details of all columns that exist in the primary key
  • fphp_Unique: details of all unique keys; keys with multiple columns are separated by ;
  • fphp_SortOrder: after which columns should the data records be sorted; true ascending, false descending
  • fphp_Interval: how many records should be displayed per page
  • fphp_View: which columns should be displayed by default
The Twig can then be created as an object in PHP and database operations can be performed. (see Using forestTwig)

Trunk Settings

Like any web application, forestPHP also has a central settings section that applies to all parts of the web application. These central settings can be extended and restricted at any time and with any version. There are the following settings options:

  • General - General settings such as the general language code for the web application, formats of date and timestamp and verification of UUID generation (extra SELECT before an INSERT, check if a generated UUID already exists in the table).
  • Session - Setting how long the validity of a session may last.
  • Form Key - form-key settings for forestPHP forms - possibility of activating the feature for all forms and settings for minimum and maximum validity of the form with form-key.
  • Navbar - Navbar Settings for bootstrap classes, web application title and how many navigation levels can be displayed at maximum.
  • Other - Settings for UTF-8 encoding or decoding for incoming and outgoing data.

Dynamic Tablefields

forestPHP has set itself the objective to provide all administrative settings in the same web application. This includes the creation of tables and their columns or tablefields. Storing this information in the database, rather than in forestTwig files, allows flexible and dynamic use of tablefields, as well as simple enhancements of functionality in the future for existing configurations. Nevertheless, the basic definition of a tablefield in a forestTwig file is still mandatory.

The chapter Creating a new Twig(table) already explained how to create a table. In order to support the automatic form generation in forestPHP, tablefields and their information for forestPHP must also be visible. Therefore, the following information about tablefields is stored in the sys_fphp_tablefields table:

  • TableUUID - The UUID of the table record to which the tablefield belongs.
  • FieldName - The name of the tablefield which must match 1-to-1 of the label in the SQL table.
  • FormElementUUID - The UUID of the form element record with which the tablefield should be displayed in a form.
  • SqlTypeUUID - The UUID of the SQL type record with which type the tablefield in an SQL table should be retrieved and stored.
  • ForestDataUUID - The UUID of the forest data record with which forestData class the value from the SQL table record should be encapsulated in forestPHP.
  • TabId - In which tab in a form the tablefield should be listed. (Default = general)
  • JSONEncodedSettings - All possible settings for the tablefield and its HTML form element. These settings are saved as JSON array. Thus, forestPHP prevents the inflexible countless columns in the SQL table sys_fphp_tablefields for all these settings.
  • FooterElement - Specifies whether the tablefield should be listed in the footer of the form.
  • SubRecordField - If the tablefield is a tablefield of a sub record, it will indicate in which SQL column the value for the tablefield should be stored.
  • Order - In which order the tablefield should be listed in a tab in a form.

CRUD Actions

CRUD(Create, Read, Update and Delete) is an acronym for the four fundamental operations of data management. Because these fundamental operations are necessary in every web application, forestPHP has created generic functions to allow these operations for any kind of record.

Implementing these functions simply requires reference to them in the branch declaration. However, it is also possible for the developer to define these generic functions differently for each branch and thus completely re-create them. So one is not strictly bound to the application of these functions. There are four standard actions that forestPHP supports:

  • viewAction - display a record
  • newAction - create a record
  • editAction - edit a record
  • deleteAction - delete a record
The class forestBranch faces four standard actions against four functions which the operations are performed automatically:
  • viewRecord - invokes a modal form to display all fields of a record
  • newRecord - invokes a modal form to add a record
  • editRecord - calls a modal form to edit a record
  • deleteRecord - calls a modal form asking if the record should be deleted

The following branch declaration to the sessionBranch shows the implementation of the operations. There are additional functions (e.g. beforeNewAction() or afterDeleteAction()) to use the record data before or after the creation / editing / deletion or to use the data in some other way. However, this only works if the generic functions are also used for the operations. To make this possible you can use these additional functions in the branch declaration. In forestBranch, there are no default functions for extra functions.

						
class sessionBranch extends forestBranch {
	use forestData;
	
	/* Fields */
	
	/* Properties */
	
	/* Methods */
	
	protected function initBranch() {
		$this->Filter->value = true;
		$this->StandardView = forestBranch::LIST;
		$this->KeepFilter->value = false;
		
		$this->Twig = new sessionTwig();
	}
	
	protected function init() {
		$o_glob = forestGlobals::init();
		
		if ($this->StandardView == forestBranch::DETAIL) {
			$this->GenerateView();
		} else if ($this->StandardView == forestBranch::LIST) {
			$this->GenerateListView();
		}
	}
	
		protected function beforeViewAction() {
			/* $this->Twig holds current record */
		}
	
	protected function viewAction() {
		$this->ViewRecord();
	}
	
		protected function afterViewAction() {
			/* $this->Twig holds current record */
		}
	
		protected function beforeNewAction() {
			/* $this->Twig holds current record */
		}
	
	protected function newAction() {
		$this->NewRecord();
	}
	
		protected function afterNewAction() {
			/* $this->Twig holds current record */
		}
		
		protected function beforeEditAction() {
			/* $this->Twig holds current record */
		}
			
	protected function editAction() {
		$this->EditRecord();
	}
	
		protected function afterEditAction() {
			/* $this->Twig holds current record */
		}
		
		protected function beforeDeleteAction() {
			/* $this->Twig holds current record */
		}
		
	protected function deleteAction() {
		$this->DeleteRecord();
	}
	
		protected function afterDeleteAction() {
			/* $this->Twig holds current record */
		}
}
						
					

File Handling

For file handling, forestPHP has implemented a very strong generic concept. Target is that it's very easy to attach files to records but also to remove them or replace them. Thus, it was excluded to include the common file fields such as filename, path, etc. in each table. Ultimately, all files of all records within the forestPHP framework are maintained in a table (sys_fphp_files). Only the primary key is stored in the main data record. This ensures flexible use of files in the future.

forestPHP has decided not to store files and their content in relational databases. Other approaches, e.g. MongoDB can guarantee better functionality here. Instead, forestPHP saves all files in a subfolder structure ( fphp_files) of the branch to which the record belongs. Each subfolder has a hexadecimal notation with 2 characters - from 00, 01, 02, 03, ... to ..., FC, FD, FE, FF. All uploaded files are also given a hexadecimal name of 8 random characters (e.g., A5E12C33). The last two characters in the name indicate the folder where the file is saved: So A5E12C33 is stored in folder 33. Thus, it is imperative that the user instance of the web server service gets the permission to create and delete folders, as well as copy and delete files into folders. It's up to each operator how the security concept for file access looks in detail.

Sub Constraints & Sub Records

It is a very common use case when managing data that you want to assign multiple sub records to a record. Often one also speaks of a division of header data and row data. For this scenario forestPHP has developed the concept with Sub Constraints & Sub Records.

Sub Constraints refers to the configuration that defines which tables are related to each other. There is once the Head Table which corresponds to the table providing the records for the header data. The Sub Table is the specification of the table where the records for the row data are provided. The relationship between header and row data is always 1 .. n. This means that a table can create any number of relationships with other tables to create rows or sub records. This configuration also defines which existing tablefields of the Sub Table are displayed by default in the Sub Records. It is therefore also always necessary when creating a Sub Records to select a record of the Sub Table beforehand and then to fill in any tablefields that contain further information.

Sub Records consist of tablefields of the configured relation of the tables among each other as well as of newly defined tablefields. Here forestPHP uses the principle of dynamic tablefields: Instead of assigning tablefields to a table, it is now possible to assign tablefields to a Sub Constraint. Because of the set configuration of Sub Constraints, this relationship is always unique as with a real table. For this purpose, when creating tablefields, there is the field SubRecordField to specify in which SQL column the value for the tablefield should be stored.

Finally, the question is how to store these sub records in the database. forestPHP has decided to save all sub records in a SQL table (sys_fphp_subrecords). This table is then created with enough different columns and types covering almost all use cases. This concept has the advantage that all sub records are stored centrally and that there is no unmanageable number of sub record tables. In case of intensive use of sub records, the use of an optimal indexing of the table sys_fphp_subrecords in the database system should be sufficient to guarantee access times satisfactorily. If necessary, it is still possible in individual cases to deviate from the forestPHP standard and to create extra sub record tables and to adapt this also in the source code.

Root Menu

With the Root Menu all administrative functions are finally grouped in one place. Previously, these operations had to be done intricately in the SQL database itself, which could jeopardize the error proneness for a productive web application.

Any number of Branches can now be added, changed and deleted at any level. Changing the navigation order is also provided with the MoveUp + MoveDown actions. It should be noted that branches with system tables can not be changed in general. This will then be made clear with a warning message.

It is now also possible to add, edit or remove custom actions in addition to the CRUD actions for each branch. This is now available in the menu item display Branch.

In order to connect a Branch to a table, a Twig create can now be selected in the Root Menu. The table name is already predefined by the name of the branch. Only further settings can be made to the table. Furthermore, at least one new tablefield must be defined for the new table. By default, the new table always gets the columns id and uuid. As with all other administrative functions, Twig can be changed and deleted. It should be noted that a Branch can only be deleted if there is no longer a connection to a table. So always the Twig of a Branch has to be deleted first. In addition, all branches that are subordinate to a branch must be deleted first in order to maintain the consistency of the tree structure.

It is now also possible to add, modify and delete tablefields to a twig. For this you have to select the menu item Show Twig. The create / edit a tablefield form differs very little from the Twigs form. forestPHP has implemented a hidden feature in the JSONSettings field for the translation of field label, default values, and so on. In order to create the translation as well when creating a new table field, use the following syntax: "Label":"#formTextLabel=Text:#", "SortHeader":"#sortText=Text#". The specification is enclosed by #. First the name of the translation is given, then the actual value. The language code used corresponds to the language code in the trunk settings.
The subsequent change from the SQL type of a tablefield should be done with existing data records with care.

Furthermore, translations can also be subsequently adapted or added, as well as unique-keys and sort-columns. All changes will then be reflected in the Twig-file. Depending on the web server, this may take several seconds. Also, validation rules can now be added to a table field. To do this, select the menu item Show tablefield in the section Tablefields for a tablefield. Here you can then add as many validation rules as you want.

The administration of Sub Constraints completes the possibilities of managing twigs. Once a Sub Contraint has been added, there is a new section for the twig to add tablefields for this Sub Constraint. Sub Constraints can be changed in their order, as well as the display of columns of the Sub Table when creating a Sub Record.

Using forestSQLQuery

Any SQL query can actually be passed as a normal string to the database system. However, SQL queries can also be complicated very quickly and thus increase the error rate. Add to that the complication that not every database system uses the same syntax of SQL. forestPHP has therefore created an object-oriented approach to SQL queries. SQL queries are created from an interaction of multiple classes and objects. This means that measures against SQL injection attacks can also be carried out centrally. It is worth mentioning that when creating a new object for an SQL query, the base gateway must always be specified. This differentiates between the individual database systems, so that you only have to create an SQL query object-oriented once and you can add syntax changes for new database systems afterwards by adapting them to the forestSQLQuery class.

Adding the DDL now also allows queries to create and modify tables.

Below are examples for SQL queries listed as class objects. Values such as aggregations, operators and comparison operators are also checked and, if necessary, an error message is generated if these are not available at all.

						
// +-----------------------------+
// |                             |
// | forestSQLQuery Select       |
// |                             |
// +-----------------------------+
$querySelect = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::SELECT, 'tableA');
	#### Columns ##########################################################################
	$column_A = new forestSQLColumn($querySelect);
		$column_A->Column = 'columnA';

	$column_B = new forestSQLColumn($querySelect);
		$column_B->Column = 'columnB';
		$column_B->SqlAggregation = 'MIN';
	
	$column_C = new forestSQLColumn($querySelect);
		$column_C->Column = 'columnC';
		$column_C->Name = 'Spalte C';
	
	$querySelect->Query->Columns->Add($column_A);
	$querySelect->Query->Columns->Add($column_B);
	$querySelect->Query->Columns->Add($column_C);
	#### Joins ############################################################################
	$join_A = new forestSQLJoin($querySelect);
		$join_A->JoinType = 'INNER JOIN';
		$join_A->Table = 'tableB';

	$relation_A = new forestSQLRelation($querySelect);
	
	$column_D = new forestSQLColumn($querySelect);
		$column_D->Table = $join_A->Table;
		$column_D->Column = 'columnD';
	
	$relation_A->BracketStart = true;		
	$relation_A->ColumnLeft = $column_D;
	$relation_A->ColumnRight = $column_A;
	$relation_A->Operator = '=';
	
	$relation_B = new forestSQLRelation($querySelect);
	
	$column_E = new forestSQLColumn($querySelect);
		$column_E->Table = $join_A->Table;
		$column_E->Column = 'columnE';
		$column_E->SqlAggregation = 'SUM';
	
	$relation_B->BracketEnd = true;	
	$relation_B->ColumnLeft = $column_E;
	$relation_B->ColumnRight = $column_B;
	$relation_B->Operator = '<=';
	$relation_B->FilterOperator = 'AND';
	
	$join_A->Relations->Add($relation_A);
	$join_A->Relations->Add($relation_B);
		
	$querySelect->Query->Joins->Add($join_A);
	##### Where ############################################################################
	$where_A = new forestSQLWhere($querySelect);
		$where_A->Column = $column_A;
		$where_A->Value = $where_A->ParseValue('Wert');
		$where_A->Operator = '<>';
	
	$where_B = new forestSQLWhere($querySelect);
		$where_B->Column = $column_D;
		$where_B->Value = $where_B->ParseValue(123);
		$where_B->Operator = '>=';
		$where_B->FilterOperator = 'XOR';
		
	$querySelect->Query->Where->Add($where_A);
	$querySelect->Query->Where->Add($where_B);
	#### GroupBy ##########################################################################
	$querySelect->Query->GroupBy->Add($column_A);
	$querySelect->Query->GroupBy->Add($column_D);
	#### Having ###########################################################################
	$where_C = new forestSQLWhere($querySelect);
		$where_C->BracketStart = true;
		$where_C->Column = $column_B;
		$where_C->Value = $where_C->ParseValue(456);
		$where_C->Operator = '<=';
		
	$where_D = new forestSQLWhere($querySelect);
		$where_D->BracketEnd = true;
		$where_D->Column = $column_A;
		$where_D->Value = $where_D->ParseValue('Trew');
		$where_D->Operator = '=';
		$where_D->FilterOperator = 'AND';
	
	$querySelect->Query->Having->Add($where_C);
	$querySelect->Query->Having->Add($where_D);	
	#### OrderBy ##########################################################################
	$querySelect->Query->OrderBy->AddColumn($column_D, true);
	$querySelect->Query->OrderBy->AddColumn($column_A, false);
	#### Limit ############################################################################
	$querySelect->Query->Limit->Start = 0;
	$querySelect->Query->Limit->Interval = 10;
	
echo $querySelect;

// +-----------------------------+
// |                             |
// | forestSQLQuery Insert       |
// |                             |
// +-----------------------------+
$queryInsert = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::INSERT, 'tableA');
	#### Columns ##########################################################################
	$column_A = new forestSQLColumnValue($queryInsert);
		$column_A->Column = 'columnA';
		$column_A->Value = $column_A->ParseValue('Wert');
	
	$column_B = new forestSQLColumnValue($queryInsert);
		$column_B->Column = 'columnB';
		$column_B->Value = $column_B->ParseValue(123);
		
	$column_C = new forestSQLColumnValue($queryInsert);
		$column_C->Column = 'columnC';
		$column_C->Value = $column_C->ParseValue('Wert2');
		
	$queryInsert->Query->ColumnValues->Add($column_A);
	$queryInsert->Query->ColumnValues->Add($column_B);
	$queryInsert->Query->ColumnValues->Add($column_C);

echo $queryInsert;

// +-----------------------------+
// |                             |
// | forestSQLQuery Update       |
// |                             |
// +-----------------------------+
$queryUpdate = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::UPDATE, 'tableA');
	#### Columns ##########################################################################
	$column_A = new forestSQLColumnValue($queryUpdate);
		$column_A->Column = 'columnA';
		$column_A->Value = $column_A->ParseValue('Wert');
	
	$column_B = new forestSQLColumnValue($queryUpdate);
		$column_B->Column = 'columnB';
		$column_B->Value = $column_B->ParseValue(123);
		
	$column_C = new forestSQLColumnValue($queryUpdate);
		$column_C->Column = 'columnC';
		$column_C->Value = $column_C->ParseValue('Wert2');
	
	$queryUpdate->Query->ColumnValues->Add($column_A);
	$queryUpdate->Query->ColumnValues->Add($column_B);
	$queryUpdate->Query->ColumnValues->Add($column_C);
	##### Where ############################################################################
	$column_A = new forestSQLColumn($queryUpdate);
		$column_A->Column = 'columnA';
	
	$column_B = new forestSQLColumn($queryUpdate);
		$column_B->Column = 'columnB';
		
	$where_A = new forestSQLWhere($queryUpdate);
		$where_A->Column = $column_A;
		$where_A->Value = $where_A->ParseValue('Wert1');
		$where_A->Operator = '<>';
	
	$where_B = new forestSQLWhere($queryUpdate);
		$where_B->Column = $column_B;
		$where_B->Value = $where_B->ParseValue('Wert2');
		$where_B->Operator = '=';
		$where_B->FilterOperator = 'OR';
		
	$queryUpdate->Query->Where->Add($where_A);
	$queryUpdate->Query->Where->Add($where_B);
	
echo $queryUpdate;

// +-----------------------------+
// |                             |
// | forestSQLQuery Delete       |
// |                             |
// +-----------------------------+
$queryDelete = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::DELETE, 'tableA');
	##### Where ############################################################################
	$column_A = new forestSQLColumn($queryDelete);
		$column_A->Column = 'columnA';
	
	$column_B = new forestSQLColumn($queryDelete);
		$column_B->Column = 'columnB';
		
	$where_A = new forestSQLWhere($queryDelete);
		$where_A->Column = $column_A;
		$where_A->Value = $where_A->ParseValue('Wert1');
		$where_A->Operator = '<>';
	
	$where_B = new forestSQLWhere($queryDelete);
		$where_B->Column = $column_B;
		$where_B->Value = $where_B->ParseValue('Wert2');
		$where_B->Operator = '=';
		$where_B->FilterOperator = 'OR';
		
	$queryDelete->Query->Where->Add($where_A);
	$queryDelete->Query->Where->Add($where_B);
	
echo $queryDelete;

// +-----------------------------+
// |                             |
// | forestSQLQuery Create       |
// |                             |
// +-----------------------------+
$o_queryCreate = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::CREATE, 'test');
		
	$o_columnA = new forestSQLColumnStructure($o_queryCreate);
		$o_columnA->Name = 'Id';
		$o_columnA->ColumnType = 'INT';
		$o_columnA->ConstraintList->Add('NOT NULL');
		$o_columnA->ConstraintList->Add('PRIMARY KEY');
		$o_columnA->ConstraintList->Add('AUTO_INCREMENT');
	
	$o_columnB = new forestSQLColumnStructure($o_queryCreate);
		$o_columnB->Name = 'UUID';
		$o_columnB->ColumnType = 'VARCHAR';
		$o_columnB->ColumnTypeLength = 36;
		$o_columnB->ConstraintList->Add('NOT NULL');
		$o_columnB->ConstraintList->Add('UNIQUE');
	
	$o_columnC = new forestSQLColumnStructure($o_queryCreate);
		$o_columnC->Name = 'Text';
		$o_columnC->ColumnType = 'VARCHAR';
		$o_columnC->ColumnTypeLength = 255;
		
	$o_columnD = new forestSQLColumnStructure($o_queryCreate);
		$o_columnD->Name = 'LocalTime';
		$o_columnD->ColumnType = 'TIMESTAMP';
		$o_columnD->ConstraintList->Add('NULL');
		
	$o_queryCreate->Query->Columns->Add($o_columnA);	
	$o_queryCreate->Query->Columns->Add($o_columnB);
	$o_queryCreate->Query->Columns->Add($o_columnC);
	$o_queryCreate->Query->Columns->Add($o_columnD);
	
echo $o_queryCreate;

// +-----------------------------+
// |                             |
// | forestSQLQuery Alter        |
// |                             |
// +-----------------------------+
$o_queryAlter = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::ALTER, 'test');
		
	$o_columnA = new forestSQLColumnStructure($o_queryAlter);
		$o_columnA->Name = 'AMOUNT';
		$o_columnA->ColumnType = 'DECIMAL';
		$o_columnA->AlterOperation = 'ADD';
		$o_columnA->ConstraintList->Add('NOT NULL');
		
	$o_columnB = new forestSQLColumnStructure($o_queryAlter);
		$o_columnB->Name = 'Text';
		$o_columnB->ColumnType = 'TEXT';
		$o_columnB->AlterOperation = 'CHANGE';
		$o_columnB->ConstraintList->Add('NOT NULL');
	
	$o_columnC = new forestSQLColumnStructure($o_queryAlter);
		$o_columnC->Name = 'UUID';
		$o_columnC->ColumnType = 'VARCHAR';
		$o_columnC->ColumnTypeLength = 36;
		$o_columnC->AlterOperation = 'DROP';
		$o_columnC->ConstraintList->Add('NOT NULL');
		$o_columnC->ConstraintList->Add('UNIQUE');
	
	$o_queryAlter->Query->Columns->Add($o_columnA);	
	$o_queryAlter->Query->Columns->Add($o_columnB);
	$o_queryAlter->Query->Columns->Add($o_columnC);
	
echo $o_queryAlter;

// +-----------------------------+
// |                             |
// | forestSQLQuery Drop         |
// |                             |
// +-----------------------------+
$o_queryDrop = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::DROP, 'test');

echo $o_queryDrop;
						
					

Using forestTwig

SQL queries using the forestSQLQuery class can then be applied to a forestTwig. To avoid having to generate SQL query objects for each table, forestPHP has developed methods for the class forestTwig to provide basic queries such as INSERT, UPDATE, SELECT or DELETE for each forestTwig object. Based on the information from forestTwig files, all columns, primary keys, unique keys, sort order, and so on are already known. This information can then be used to automatically generate CRUD queries. This makes working with tables in the forestPHP Framework a lot easier and can be used at will. There is still the freedom to create and execute your own SQL queries.

The following examples demonstrate how to use Twig objects to perform database operations and call results.

						
$o_actionTwig = new actionTwig;

$o_actionTwig->GetRecord(array(1));

echo $o_actionTwig->Name;

$o_branchTwig = new branchTwig;
$o_records = $o_branchTwig->GetAllRecords();

foreach($o_records->Twigs as $o_record) {
	echo $o_record->Name;
	
	$o_record->Name += '_Change';
	
	$o_record->Update();
}

if ($o_branchTwig->GetRecord(array(42))) {
	$o_branchTwig->DeleteRecord();
}



$o_querySelect = new forestSQLQuery($o_glob->Base->{$o_glob->ActiveBase}->BaseGateway, forestSQLQuery::SELECT, 'sys_fphp_action');
					
	$column_A = new forestSQLColumn($o_querySelect);
		$column_A->Column = 'BranchId';
	
	$column_B = new forestSQLColumn($o_querySelect);
		$column_B->Column = 'Name';

$o_querySelect->Query->Columns->Add($column_A);
$o_querySelect->Query->Columns->Add($column_B);
	
$column_C = new forestSQLColumn($o_querySelect);
	$column_C->Column = 'Id';

$where_A = new forestSQLWhere($o_querySelect);
	$where_A->Column = $column_C;
	$where_A->Value = $where_A->ParseValue(5);
	$where_A->Operator = '>';

$o_querySelect->Query->Where->Add($where_A);

$o_result = $o_glob->Base->{$o_glob->ActiveBase}->FetchQuery($o_querySelect);

foreach($o_result->Twigs as $o_record) {
	echo $o_record->ShowFields(false, true); // print every field of the record with field's value
}
						
					

Using forestObjectList

PHP arrays can hold a different data type per element. This is good for a flexible programming experience. However, you often need an array, where you can rely on every element of the same type. For example, in forestPHP, there are some lists of objects based on forestPHP classes, a list of records in the form of forestTwig objects. To make this possible, the forestPHP framework has created the construct of the object list. When creating an object list, you specify which classes accept the list as elements. So you can encapsulate your data according to classes and uniformly put in PHP arrays and again retrieve your data with a foreach loop, for example.

The following source code shows how easy an object list can be created and used.

						
// create three objects of actionTwig
$o_actionTwigOne = new actionTwig;
$o_actionTwigOne->BranchId = 42;
$o_actionTwigOne->Name = 'Action One';

$o_actionTwigTwo = new actionTwig;
$o_actionTwigTwo->BranchId = 42;
$o_actionTwigTwo->Name = 'Action Two';

$o_actionTwigThree = new actionTwig;
$o_actionTwigThree->BranchId = 42;
$o_actionTwigThree->Name = 'Action Three';

$ol_list = new forestObject(new forestObjectList('actionTwig'), false); // object list only allows objects with class 'actionTwig'; false mean this object can not be overwritten

$ol_list->Add($o_actionTwigOne, 'one'); // string-key is optional, default is numeration keys starting with 0
$ol_list->Add($o_actionTwigTwo, 'two');
$ol_list->Add($o_actionTwigThree, 'three');

foreach ($ol_list as $s_key => $o_action) {
	// listing each action object with key and name
	echo $s_key . ': ' . $o_action->Name . '<br>' . "\n";
}
						
					

Using forestForm

Forms in web applications have become indispensable today. Without a consistent line, forms on a web page can become chaotic and confusing very quickly. For this reason, forestPHP supports forestForm and forestFormElement classes to automatically generate, modify and delete records with a consistent and clear presentation.

There are the following form elements in the forestFormElement class:

  • FORM - corresponds to HTML <form>-element
  • TEXT - corresponds to HTML <input type="text">-element
  • HIDDEN - corresponds to HTML <input type="hidden">-element
  • PASSWORD - corresponds to HTML <input type="password">-element
  • LIST - corresponds to HTML <input type="list">-element
  • RADIO - corresponds to HTML <input type="radio">-element
  • CHECKBOX - corresponds to HTML <input type="checkbox">-element
  • COLOR - corresponds to HTML <input type="color">-element
  • EMAIL - corresponds to HTML <input type="email">-element
  • URL - corresponds to HTML <input type="url">-element
  • DATE - corresponds to HTML <input type="date">-element
  • DATETIMELOCAL - corresponds to HTML <input type="datetime-local">-element
  • MONTH - corresponds to HTML <input type="month">-element
  • NUMBER - corresponds to HTML <input type="number">-element
  • RANGE - corresponds to HTML <input type="range">-element
  • SEARCH - corresponds to HTML <input type="search">-element
  • PHONE - corresponds to HTML <input type="phone">-element
  • TIME - corresponds to HTML <input type="time">-element
  • WEEK - corresponds to HTML <input type="week">-element
  • TEXTAREA - corresponds to HTML <textarea>-element
  • SELECT - corresponds to HTML <select>-element
  • DESCRIPTION - corresponds to small description field between forms elements
  • BUTTON - corresponds to HTML <button>-element
  • RICHTEXT - a Richtext element developed by forestPHP
  • DROPZONE - a forestPHP-developed dropzone element for easy upload handling of files in a form using drag&drop and / or copy&paste

Basically, all forms are displayed in forestPHP as a modal form. A graphical control that is subordinate to the main window of an application. A mode is created that disables the main window but keeps it visible, displaying the modal window as a child window in front of it. Within the modal form it is possible to arrange the individual elements of the form in any number of tabs and additional labels.

In order not to reprogram a form over and over again for every use case, forestPHP supports automatic form generation. With the information from the table and tablefields from the database and assigning a forestTwig record when creating the form, a form for creating or editing a record can be generated completely automatically. Thus, forestPHP forms rely directly on the tablefields datasets for the same dynamic management and flexibility benefits: once a new tablefield is administratively added to the table, it becomes automatic added to the form. Where previously you had to make programmatic changes in two places, this is no longer necessary with forestPHP.

However, as the validation of form input data also takes on an increasingly important role, forestPHP uses the functionality of jQuery Validate to couple individual form elements with validation rules that specify the input to check data before the user can submit the form. This ability is also configured within the forestPHP database by linking validation records to tablefields.

There are the following validation rules:

  • dateISO - uses the jQuery Validate rule 'dateISO' on the form element
  • digits - uses the jQuery Validate rule 'digits' on the form element(nur Zahlen [0-9])
  • email - uses the jQuery Validate rule 'email' on the form element
  • equalTo - uses the jQuery Validate rule 'equalTo' on the form element
  • fphp_dateDMYpoint - integration of the forestPHP rule 'fphp_dateDMYpoint' using the jQuery Validate logic on the form element
  • fphp_dateDMYslash - integration of the forestPHP rule 'fphp_dateDMYslash' using the jQuery Validate logic on the form element
  • fphp_dateinterval - integration of the forestPHP rule 'fphp_dateinterval' using the jQuery Validate logic on the form element
  • fphp_dateISO - integration of the forestPHP rule 'fphp_dateISO' using the jQuery Validate logic on the form element
  • fphp_dateMDYslash - integration of the forestPHP rule 'fphp_dateMDYslash' using the jQuery Validate logic on the form element
  • fphp_datetime - integration of the forestPHP rule 'fphp_datetime' using the jQuery Validate logic on the form element
  • fphp_datetimeISO - integration of the forestPHP rule 'fphp_datetimeISO' using the jQuery Validate logic on the form element
  • fphp_month - integration of the forestPHP rule 'fphp_month' using the jQuery Validate logic on the form element
  • fphp_onlyletters - integration of the forestPHP rule 'fphp_onlyletters' using the jQuery Validate logic on the form element
  • fphp_password - integration of the forestPHP rule 'fphp_password' using the jQuery Validate logic on the form element
  • fphp_time - integration of the forestPHP rule 'fphp_time' using the jQuery Validate logic on the form element
  • fphp_username - integration of the forestPHP rule 'fphp_username' using the jQuery Validate logic on the form element
  • fphp_week - integration of the forestPHP rule 'fphp_week' using the jQuery Validate logic on the form element
  • max - uses the jQuery Validate rule 'max' on the form element
  • maxlength - uses the jQuery Validate rule 'maxlength' on the form element
  • min - uses the jQuery Validate rule 'min' on the form element
  • minlength - uses the jQuery Validate rule 'minlength' on the form element
  • number - uses the jQuery Validate rule 'number' on the form element(nur Dezimalzahlen)
  • range - uses the jQuery Validate rule 'range' on the form element
  • rangelength - uses the jQuery Validate rule 'rangelength' on the form element
  • remote - uses the jQuery Validate rule 'remote' on the form element
  • required - uses the jQuery Validate rule 'required' on the form element
  • url - uses the jQuery Validate rule 'url' on the form element

To increase the security of form operations in forestPHP, the following measures have been implemented:

  • form-key - the automatic generation of a form also creates a form-key for the form and the user. This form-key has a timestamp and the function that can submit this form only once. This prevents resubmitting of forms with F5 after an already processed form. The timestamp prevents a form from being used for hours (or even days) in an open browser tab / window. The use of form-key is completely configured in the trunk settings.

But even with these useful features, it is possible to create and use manual programmed forms within forestPHP as the following source code examples show:

						
/****************************************/
/*********Modal Tab Form Example*********/
/****************************************/
$o_glob->PostModalForm = new forestForm($this->Twig);

$o_glob->PostModalForm->FormTabConfiguration->Tab = true;
$o_glob->PostModalForm->FormTabConfiguration->TabMenuClass = 'nav nav-tabs';
$o_glob->PostModalForm->FormTabConfiguration->TabActiveClass = 'active';
$o_glob->PostModalForm->FormTabConfiguration->TabToggle = 'tab';
$o_glob->PostModalForm->FormTabConfiguration->TabContentClass = 'tab-content';
$o_glob->PostModalForm->FormTabConfiguration->TabFooterClass = 'tab-footer';
$o_glob->PostModalForm->FormTabConfiguration->TabElementClass = 'tab-pane fade';
$o_glob->PostModalForm->FormTabConfiguration->TabElementActiveClass = 'tab-pane fade in active';

$o_glob->PostModalForm->FormModalConfiguration->Modal = true;
$o_glob->PostModalForm->FormModalConfiguration->ModalClass = 'modal fade';
$o_glob->PostModalForm->FormModalConfiguration->ModalId = 'myModal';
$o_glob->PostModalForm->FormModalConfiguration->ModalTitle = '<h4>Modal Form</h4>';
$o_glob->PostModalForm->FormModalConfiguration->ModalRole = 'dialog';
$o_glob->PostModalForm->FormModalConfiguration->ModalDialogClass = 'modal-dialog modal-lg';
$o_glob->PostModalForm->FormModalConfiguration->ModalDialogContentClass = 'modal-content';
$o_glob->PostModalForm->FormModalConfiguration->ModalHeaderClass = 'modal-header';
$o_glob->PostModalForm->FormModalConfiguration->ModalHeaderCloseClass = 'close';
$o_glob->PostModalForm->FormModalConfiguration->ModalHeaderDismissClass = 'modal';
$o_glob->PostModalForm->FormModalConfiguration->ModalHeaderCloseContent = '×';
$o_glob->PostModalForm->FormModalConfiguration->ModalBodyClass = 'modal-body';
$o_glob->PostModalForm->FormModalConfiguration->ModalFooterClass = 'modal-footer';

$o_glob->PostModalForm->FormObject->Class = 'form-horizontal';
$o_glob->PostModalForm->FormObject->FormGroupClass = 'form-group';
$o_glob->PostModalForm->FormObject->LabelClass = 'col-sm-3 control-label';
$o_glob->PostModalForm->FormObject->FormElementClass = 'col-sm-9';
$o_glob->PostModalForm->FormObject->ClassAll = 'form-control';
$o_glob->PostModalForm->FormObject->RadioClass = 'radio';
$o_glob->PostModalForm->FormObject->CheckboxClass = 'checkbox';

$o_text = new forestFormElement(forestFormElement::TEXT);
$o_text->Label = 'Text:';
$o_text->Id = 'text01';
$o_text->Placeholder = 'Enter a text...';
$o_text->ValMessage = 'Please enter a text';

$o_password = new forestFormElement(forestFormElement::PASSWORD);
$o_password->Label = 'Password:';
$o_password->Id = 'password01';
$o_password->Placeholder = 'Enter a password...';
$o_password->ValMessage = 'Please enter a password';
$o_password->Description = 'Mind. 1 Groß-, 1 Kleinbuchstabe, 1 Sonderzeichen und 1 Zahl.';
$o_password->DescriptionClass = 'text-right text-info';

$o_hidden = new forestFormElement(forestFormElement::HIDDEN);
$o_hidden->Id = 'hidden01';
$o_hidden->Value = 'hiddenValue';

$o_list = new forestFormElement(forestFormElement::LIST);
$o_list->Label = 'List:';
$o_list->Id = 'list01';
$o_list->List = 'browsers';
$o_list->Placeholder = 'Enter a browser...';
$o_list->ValMessage = 'Please enter a browser';
$o_list->Options = array('Internet Explorer' => 'ie', 'Firefox' => 'ff', 'Chrome' => 'ch', 'Opera' => 'op', 'Safari' => 'sf');

$o_file = new forestFormElement(forestFormElement::FILE);
$o_file->Label = 'File:';
$o_file->Id = 'file01';
$o_file->ValMessage = 'Please choose a file';
$o_file->Multiple = true;

$o_fileCamera = new forestFormElement(forestFormElement::FILE);
$o_fileCamera->Label = 'Picture:';
$o_fileCamera->Id = 'file02';
$o_fileCamera->ValMessage = 'Please take a picture';
$o_fileCamera->Accept = 'image/*';
$o_fileCamera->Capture = 'camera';

$o_radio = new forestFormElement(forestFormElement::RADIO);
$o_radio->Label = 'Radios:';
$o_radio->Id = 'radio01';
$o_radio->ValMessage = 'Please choose an option';
$o_radio->Options = array('Deutschland' => 'de', 'Österreich' => 'au', 'Schweiz' => 'ch');

$o_radioInline = new forestFormElement(forestFormElement::RADIO);
$o_radioInline->Label = 'Radio-Inline:';
$o_radioInline->Id = 'radio02';
$o_radioInline->RadioClass = 'radio-inline';
$o_radioInline->Break = false;
$o_radioInline->ValMessage = 'Please choose an option';
$o_radioInline->Value = 'eu';
$o_radioInline->Options = array('Europa' => 'eu', 'USA' => 'us', 'Asien' => 'as');

$o_checkbox = new forestFormElement(forestFormElement::CHECKBOX);
$o_checkbox->Id = 'checkbox01';
$o_checkbox->ValMessage = 'Please choose an option';
$o_checkbox->Options = array('AGB' => 'agb');
$o_checkbox->Description = 'Single-Checkbox without Label.';
$o_checkbox->DescriptionClass = 'text-right text-info';

$o_checkbox02 = new forestFormElement(forestFormElement::CHECKBOX);
$o_checkbox02->Label = 'Checkboxes:';
$o_checkbox02->Id = 'checkbox02[]';
$o_checkbox02->ValMessage = 'Please choose an option';
$o_checkbox02->Options = array('Option 1' => 'opt1', 'Option 2' => 'opt2', 'Option 3' => 'opt3', 'Option 4' => 'opt4');

$o_checkbox03 = new forestFormElement(forestFormElement::CHECKBOX);
$o_checkbox03->Label = 'Checkboxes-Inline:';
$o_checkbox03->Id = 'checkbox03[]';
$o_checkbox03->ValMessage = 'Please choose an option';
$o_checkbox03->CheckboxClass = 'checkbox-inline';
$o_checkbox03->Break = false;
$o_checkbox03->Options = array('Option 1', 'Option 2', 'Option 3');

$o_textarea = new forestFormElement(forestFormElement::TEXTAREA);
$o_textarea->Label = 'Textarea:';
$o_textarea->Id = 'textarea01';
$o_textarea->Rows = 5;
$o_textarea->Placeholder = 'Enter a text in this textarea...';
$o_textarea->ValMessage = 'Please enter a text';

$o_select = new forestFormElement(forestFormElement::SELECT);
$o_select->Label = 'Select:';
$o_select->Id = 'select01';
$o_select->ValMessage = 'Please choose an option';
$o_select->Options = array('Option 1' => 'opt1', 'Option 2' => 'opt2', 'Option 3' => 'opt3', 'Option 4' => 'opt4');

$o_selectOpt = new forestFormElement(forestFormElement::SELECT);
$o_selectOpt->Label = 'Select-Optgroup:';
$o_selectOpt->Id = 'select02';
$o_selectOpt->Size = 3;
$o_selectOpt->Multiple = false;
$o_selectOpt->ValMessage = 'Please choose an option';
$o_selectOpt->Options = array(
'Swedish Cars' => array('Volvo' => 'volvo', 'Saab' => 'saab'),
'German Cars' => array('Mercedes' => 'mercedes', 'Audi' => 'audi'),
'Asian Cars' => array('Toyota' => 'toyota', 'Mitsubishi' => 'mitsubishi', 'Kia' => 'kia')
);

$o_description = new forestFormElement(forestFormElement::DESCRIPTION);
$o_description->Description = 'Dies ist eine kurze Beschreibung, um zwischendurch einige Elemente einfach zu erklären. :)';

$o_button = new forestFormElement(forestFormElement::BUTTON);
$o_button->ButtonType = 'submit';
$o_button->Class = 'btn btn-success btn-default pull-right';
$o_button->Id = 'submit01';
$o_button->ButtonText = '<span class="fas fa-check"></span> Submit';
$o_button->NoFormGroup = true;

$o_cancel = new forestFormElement(forestFormElement::BUTTON);
$o_cancel->ButtonType = 'submit';
$o_cancel->Class = 'btn btn-danger btn-default pull-right';
$o_cancel->Data = 'dismiss="modal"';
$o_cancel->Id = 'cancel01';
$o_cancel->Style = 'margin-left: 10px;';
$o_cancel->ButtonText = '<span class="fas fa-times"></span> Cancel';
$o_cancel->NoFormGroup = true;

$o_color = new forestFormElement(forestFormElement::COLOR);
$o_color->Label = 'Color:';
$o_color->Id = 'color01';
$o_color->ValMessage = 'Please choose a color';

$o_email = new forestFormElement(forestFormElement::EMAIL);
$o_email->Label = 'Email:';
$o_email->Id = 'email01';
$o_email->ValMessage = 'Please enter an email address';

$o_url = new forestFormElement(forestFormElement::URL);
$o_url->Label = 'URL:';
$o_url->Id = 'url01';
$o_url->ValMessage = 'Please enter an URL address';

$o_date = new forestFormElement(forestFormElement::DATE);
$o_date->Label = 'Date:';
$o_date->Id = 'date01';
$o_date->ValMessage = 'Please enter a date';
$o_date->Min = '2018-01-01';
$o_date->Step = 10;

$o_datetimelocal = new forestFormElement(forestFormElement::DATETIMELOCAL);
$o_datetimelocal->Label = 'Datetime:';
$o_datetimelocal->Id = 'datetime01';
$o_datetimelocal->ValMessage = 'Please enter a datetime';
$o_datetimelocal->Min = '2018-01-01T12:00:00';
$o_datetimelocal->Step = 20;

$o_month = new forestFormElement(forestFormElement::MONTH);
$o_month->Label = 'Month:';
$o_month->Id = 'month01';
$o_month->ValMessage = 'Please enter a month';
$o_month->Max = '2019-06';
$o_month->Step = 2;

$o_number = new forestFormElement(forestFormElement::NUMBER);
$o_number->Label = 'Number:';
$o_number->Id = 'number01';
$o_number->ValMessage = 'Please enter a number';
$o_number->Min = '-100';
$o_number->Max = '100';
$o_number->Step = 10;

$o_range = new forestFormElement(forestFormElement::RANGE);
$o_range->Label = 'Range:';
$o_range->Id = 'range01';
$o_range->ValMessage = 'Please enter a range';
$o_range->Min = '0';
$o_range->Max = '12';
$o_range->Step = 2;

$o_search = new forestFormElement(forestFormElement::SEARCH);
$o_search->Label = 'Search:';
$o_search->Id = 'search01';
$o_search->ValMessage = 'Please enter a search';

$o_phone = new forestFormElement(forestFormElement::PHONE);
$o_phone->Label = 'Phone:';
$o_phone->Id = 'phone01';
$o_phone->ValMessage = 'Please enter a phone number';

$o_time = new forestFormElement(forestFormElement::TIME);
$o_time->Label = 'Time:';
$o_time->Id = 'time01';
$o_time->ValMessage = 'Please enter a time';
$o_time->Min = '08:00:00';
$o_time->Max = '20:00:00';
$o_time->Step = 15;

$o_week = new forestFormElement(forestFormElement::WEEK);
$o_week->Label = 'Week:';
$o_week->Id = 'week01';
$o_week->ValMessage = 'Please enter a week';
$o_week->Max = '2018-W01';
$o_week->Step = 5;

$o_pattern = new forestFormElement(forestFormElement::TEXT);
$o_pattern->Label = 'Pattern:';
$o_pattern->Id = 'pattern01';
$o_pattern->ValMessage = 'Please enter a three letter country code';
$o_pattern->Pattern = '[A-Za-z]{3}';
$o_pattern->PatternTitle = 'three letter country code';

$o_tabA = new forestFormTab('menu1', 'Menu 1');
$o_tabA->FormElements->Add($o_text);
$o_tabA->FormElements->Add($o_password);
$o_tabA->FormElements->Add($o_hidden);
$o_tabA->FormElements->Add($o_list);
$o_tabA->FormElements->Add($o_file);
$o_tabA->FormElements->Add($o_fileCamera);

$o_tabB = new forestFormTab('optionen', 'Options');
$o_tabB->FormElements->Add($o_radio);
$o_tabB->FormElements->Add($o_radioInline);
$o_tabB->FormElements->Add($o_checkbox);
$o_tabB->FormElements->Add($o_checkbox02);
$o_tabB->FormElements->Add($o_checkbox03);
$o_tabB->FormElements->Add($o_textarea);
$o_tabB->FormElements->Add($o_select);
$o_tabB->FormElements->Add($o_selectOpt);

$o_tabC = new forestFormTab('other', 'Other');
$o_tabC->FormElements->Add($o_description);
$o_tabC->FormElements->Add($o_color);
$o_tabC->FormElements->Add($o_email);
$o_tabC->FormElements->Add($o_url);
$o_tabC->FormElements->Add($o_date);
$o_tabC->FormElements->Add($o_datetimelocal);

$o_tabD = new forestFormTab('settings', 'Settings');
$o_tabD->FormElements->Add($o_month);
$o_tabD->FormElements->Add($o_number);
$o_tabD->FormElements->Add($o_range);
$o_tabD->FormElements->Add($o_search);
$o_tabD->FormElements->Add($o_phone);
$o_tabD->FormElements->Add($o_time);
$o_tabD->FormElements->Add($o_week);
$o_tabD->FormElements->Add($o_pattern);

$o_glob->PostModalForm->FormFooterElements->Add($o_cancel);
$o_glob->PostModalForm->FormFooterElements->Add($o_button);
		
$o_glob->PostModalForm->FormTabs->Add($o_tabA);
$o_glob->PostModalForm->FormTabs->Add($o_tabB);
$o_glob->PostModalForm->FormTabs->Add($o_tabC);
$o_glob->PostModalForm->FormTabs->Add($o_tabD);

/************************************************/
/*********adding jQuery Validation Rules*********/
/************************************************/

$o_glob->PostModalForm->FormObject->ValRequiredMessage = 'Bitte geben Sie einen Wert an';
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('text01', 'required', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('password01', 'required', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('list01', 'required', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('checkbox01', 'required', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('select01', 'required', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('email01', 'email', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('url01', 'url', 'true'));
$o_glob->PostModalForm->FormObject->ValRules->Add(new forestFormValidationRule('search01', 'rangelength', '5', '10'));
						
					

Using forestTemplates

Templates are indispensable for reuse and have always been a staple of web applications. With the class forestTemplate forestPHP supports the use of templates. The ease of use should demonstrate by the example of a landing page template:

						
	// following steps are necessary to add a new template
	
	// 1. create a new constant in forestTemplates.php
	
	const LANDINGPAGE = 'landingpage';
	
	// 2. create another constant with the raw html part of the template with exact name of first constant ending with 'TXT'
	// in this case we just have just one substituion variable starting with 0 -> %0
	
	const LANDINGPAGETXT = <<< EOF
	%0
EOF;

	// 3. adding constant to switch clause in forestTemplates.php constructor
	
	switch ($this->Type->value) {
			.
			.
			.
			case self::LANDINGPAGE:
				$this->Type->value = self::LANDINGPAGE;
			break;
			.
			.
			.
	}
	
	.
	.
	.
	
	// how to create and use the template
	$o_glob->Templates->Add(new forestTemplates(forestTemplates::LANDINGPAGE, array('This string value will replace %0 in the template', 'if exists, this string value will replace %1 in the template', ... and so on ... )), 'myLandingPage');
	
	// template can be rendered with access $o_glob->Templates and the known key
	echo $o_glob->Templates->{'myLandingPage'};
						
					

Using forestCombination

To use forestCombination a new tablefield with Form element "text", SQL Type element "empty" and ForestData Element "forestCombination" must be created. In JSONSettings there is the setting value forestCombination which is evaluated automatically.

Examples:

  • "forestCombination":"Number-Double.# #.TestLookup.# @ #.TestLookup2" - Number, Double, TestLookup und TestLookup2 are tablefields of the current table as well as the field declared with forestCombination. In this example, we see that there is the concatenation . operator to join strings together. To include fixed strings in a forestCombination, the string must be enclosed by #. Furthermore, the basic types of calculation are possible: + - * /. It is, however, self responsible for carrying out operations on tablefields which are also provided for this purpose. A type check is not carried out.
  • "forestCombination":"IntValue+INT(42)" - There are also the two aggregations INT() and DBL(). This allows set values in the forestCombination preference value to be converted to an integer or floating-point number.
  • "forestCombination":"SUM(fphp_subtable$LinePrice)" - With the aggregation SUM() and the specification of the Sub Table and a tablefield, a sum for the tablefield is formed over all sub records for this record. It is, however, self responsible for carrying out operations on tablefields which are also provided for this purpose. A type check is not carried out.
  • "forestCombination":"CNT(fphp_subtable)" - The aggregation CNT() can be used to determine the number of existing sub records for the record.
  • "forestCombination":"fphp_article$Price*Amount" - Here's an example on a Sub Record of how to take a field from the sub constraint from the sub record table (fphp_article$Price) and multiply it with the (Amount) tablefield of the sub record to calculate the line price based on the query quota.

Using forestLookup

The principle of forestLookup is very simple. There is already a table of records, e.g. Table Selection (fphp_select). Now we create a new tablefield in table Data (fphp_data) with Form element "lookup", SQL-Type element "text[255]" and ForestData element "forestLookup". In JSONSettings you can then give the following information:

  • "forestLookupDataTable":"fphp_auswahl" - the table from which the lookup element should relate the data.
  • "forestLookupDataPrimary":["UUID"] - the unique key to a record of the lookup table.
  • "forestLookupDataLabel":["Name","Name2"] - which tablefields should be displayed when selecting a lookup record. These fields are also displayed when a lookup has been selected for a record and displayed in the List-View.

Roots

In this chapter, all forestPHP root classes public functions are documented. To keep track of the documentation, this part of the documentation is only available in English.

forestAutoLoad.php

global function __autoload uses this class to create object of classes who were not included before

							
	/**
	 * constructor of forestAutoLoad class, to load class file
	 *
	 * @param string $p_s_name  class name
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_name)
	
	/**
	 * static helper function to check if a file is readable or exists
	 *
	 * @param string $p_s_filename  path of filename + filename
	 *
	 * @return bool  true - file is readable and exists, false - file does not exists
	 *
	 * @access public
	 * @static yes
	 */
	public static function IsReadable($p_s_filename)
							
						

forestBase.php

gathering class for all database interfaces an gateways who can be used by the script collection
whole database connectivity goes over this class
on initialization the developer can decide which gateway he wants to use

							
	/**
	 * constructor of forestBase class, set connection parameters to destination database
	 *
	 * @param string $p_s_baseGateway  base-gateway constant
	 * @param string $p_s_host  host value of database server
	 * @param string $p_s_datasource  database name
	 * @param string $p_s_user  database user
	 * @param string $p_s_password  database user's password
	 * @param bool $p_b_persistentConnection  standard true, optional
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_baseGateway = '', $p_s_host = '', $p_s_datasource = '', $p_s_user = '', $p_s_password = '', $p_b_persistentConnection = true)
	
	/**
	 * destructor of forestBase class, closes current connection
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __destruct()
	
	/**
	 * function to send a query to the database and get a result set/answer/value
	 *
	 * @param forestSQLQuery $p_o_sqlQuery  sql query
	 * @param bool $p_b_transaction  use query in transaction mode
	 * @param bool $p_b_resultTwigList  convert result set into twig list
	 * @param bool $p_b_freeResult  free result memory
	 * @param integer $p_i_resultType  standard ASSOC - ASSOC, NUM, BOTH, OBJ, LAZY
	 *
	 * @return object  result set/twig list/row count
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function FetchQuery(\fPHP\Base\forestSQLQuery $p_o_sqlQuery, $p_b_transaction = false, $p_b_resultTwigList = true, $p_b_freeResult = false, $p_i_resultType = \fPHP\Base\forestBase::ASSOC)
	
	/**
	 * function to start transaction mode
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ManualTransaction()
	
	/**
	 * function to roll back all transactions
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ManualRollBack()
	 
	 /**
	 * function to end transaction mode
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ManualCommit()
	 
	/**
	 * function to get id of last insert with this connection
	 *
	 * @return integer  id of last inserted record
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function LastInsertId()
							
						

forestBranch.php

abstract class for all branches
core functionality for rendering and editing records which are managed in the twig object
sub record editing support as well
all functions can be overwritten for user specific use case

							
	/**
	 * constructor of forestBranch class
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * individual branch-classes are calling this method to set next action
	 *
	 * @param string $p_s_nextAction  name of action
	 * @param string $p_s_nextActionAfterReload  name of action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function SetNextAction($p_s_nextAction, $p_s_nextActionAfterReload = null)
	
	/**
	 * inits global filter mask for all branches and actions
	 *
	 * @return null
	 *
	 * @access protected
	 * @static no
	 */
	protected function InitFilter()
	
	
	/**
	 * clean up temp files and file records
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function CleanUpTempFiles()
	
	/**
	 * handle form key functionality
	 *
	 * @param string $p_s_formId  id of form element
	 * @param bool $p_b_postChain  true - init form key again for multiple step forms, false - normal behavior
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function HandleFormKey($p_s_formId = 'NULL', $p_b_postChain = false)
	
	
	/**
	 * generates landing page
	 *
	 * @return null
	 *
	 * @access protected
	 * @static no
	 */
	protected function GenerateLandingPage()
	
	
	/**
	 * generates list view
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function GenerateListView()
	
	/**
	 * render column value for list view
	 *
	 * @param string $p_s_value  value which should be set, passed by reference
	 * @param string $p_s_formElement  forestFormElement type
	 * @param string $p_s_column  name of column/field
	 * @param forestTwig $p_o_record  record of type forestTwig
	 * @param string $p_s_dictionaryKey  name of dictionary key, syntax: fulltablename_fieldname
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function ListViewRenderColumnValue(&$p_s_value, $p_s_formElement, $p_s_column, $p_o_record, $p_s_dictionaryKey)
	
	/**
	 * create modal form for selecting hidden columns
	 *
	 * @param forestForm $p_o_form  form object where form elements will be added to add additonal columns to the view
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function GenerateHiddenColumnsModal(\fPHP\Forms\forestForm $p_o_form)
	
	/**
	 * render search form
	 *
	 * @param string $p_s_searchForm  form object of the search form
	 * @param string $p_s_searchTerms  string container to list all search terms as badges
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function RenderSearchForm(&$p_s_searchForm, &$p_s_searchTerms)
	
	
	/**
	 * generates detail view
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function GenerateView()
	
	/**
	 * handle sub records display in detail view
	 *
	 * @param forestTwig $p_o_twig  head record where sub records will be queried from
	 * @param bool $p_b_readonly  true - show sub records without manipulation actions, false - normal view of all sub records
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function ListSubRecords(\fPHP\Twigs\forestTwig $p_o_twig, $p_b_readonly = false)
	
	
	/**
	 * handle view record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function ViewRecord()
	
	
	/**
	 * handle new record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function NewRecord()
	
	/**
	 * render modal form for new sub record
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function RenderNewSubRecordForm()
	
	/**
	 * add additional sub record field form elements to global post modal form
	 *
	 * @param subconstraintTwig $p_o_subconstraintTwig  sub constraint object where a lookup and form elements will be build dynamically
	 * @param subrecordsTwig $p_o_subrecordsTwig  record data of sub record to give values to form elements
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function AddAdditionalSubRecordFormElements(\fPHP\Twigs\subconstraintTwig $p_o_subconstraintTwig, \fPHP\Twigs\subrecordsTwig $p_o_subrecordsTwig = null)
	
	
	/**
	 * handle edit record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function EditRecord()
	
	/**
	 * render modal form for editing sub record
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function RenderEditSubRecordForm()
	
	/**
	 * write POST data into twig property fields
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function TransferPOST_Twig()
	
	/**
	 * handle FILES data
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function TransferFILES_Twig()
	
	/**
	 * undo created file records if there are any exceptions for new records or editing records
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function UndoFilesEntries()
	
	/**
	 * get validation rules of form element
	 *
	 * @param string $p_s_tableFieldUUID  uuid of tablefield which is part of validation rule primary key
	 * @param array $p_a_validationRules  array object where found validation rules will be inserted, passed by reference
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function GetValidationRules($p_s_tableFieldUUID, &$p_a_validationRules)
	
	/**
	 * handle replace file record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function replaceFileAction()
	
	/**
	 * handle delete record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function DeleteRecord()
	
	/**
	 * check twigfield relation to other elements
	 *
	 * @param forestTwig $p_o_twig 
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function CheckandCleanupRecordBeforeDeletion(\fPHP\Twigs\forestTwig $p_o_twig)
	
	/**
	 * re-usable delete record function
	 *
	 * @param forestTwig $p_o_record  record which will be deleted
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function executeDeleteRecord(\fPHP\Twigs\forestTwig $p_o_record)
	
	/**
	 * re-usable delete sub record function
	 *
	 * @param subrecordsTwig $p_o_subrecord  sub record which will be deleted
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function executeDeleteSubRecord(\fPHP\Twigs\subrecordsTwig $p_o_subrecord)
	
	/**
	 * re-usable delete file record function with history files option
	 *
	 * @param filesTwig $p_o_file  file record which will be deleted
	 * @param bool $p_b_deleteRecord  true - delete file record as well, false - only delete stored file
	 * @param bool $p_b_deleteHistoryFiles  true - check and delete all history file records as well, false - do not look for history file records
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function executeDeleteFileRecord(\fPHP\Twigs\filesTwig $p_o_file, $p_b_deleteRecord = true, $p_b_deleteHistoryFiles = false)
	
	/**
	 * handle action to change order of records, moving one record up
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function MoveUpRecord()
	
	/**
	 * handle action to change order of records, moving one record down
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function MoveDownRecord()
	
	/**
	 * handle upload actions from dropzone
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function fphp_uploadAction()
	
	/**
	 * handle upload delete actions from dropzone
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function fphp_upload_deleteAction()
	
	/**
	 * function to create and render a captcha picture
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function fphp_captchaAction()
	
	/**
	 * function to create a thumbnail of an stored image
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function fphp_imageThumbnailAction()
							
						

forestData.php

forestData trait declaring general types of data and for reuse in all fphp classes and mods

							
trait forestData {
	/**
	 * write access to value, calling further __set method
	 *
	 * @param string $p_s_name  name of the property
	 * @param object $p_o_value  value which should be set
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	 public function __set($p_s_name, $p_o_value)

	/**
	 * read access to value, calling further __get method
	 *
	 * @param string $p_s_name  name of the property
	 *
	 * @return object  object value which is stored with the property
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function &__get($p_s_name)
	
	/**
	 * unset access to value, calling further __unset method
	 *
	 * @param string $p_s_name  name of the property
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __unset($p_s_name)
}

	/**
	 * string data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestString
	
	/**
	 * list data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestList

	/**
	 * numericstring data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestNumericString

	/**
	 * integer data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestInt

	/**
	 * float data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestFloat

	/**
	 * bool data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestBool

	/**
	 * array data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestArray

	/**
	 * object data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestObject
	
	/**
	 * lookup data container
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	class forestLookup
							
						

forestDateInterval.php

date interval class with match validation of date interval strings

							
	/**
	 * constructor of forestDateInterval class
	 *
	 * @param string $p_s_dateinterval  date interval string, e.g. P2D, P1Y3M18DT5H16M33S, PT3H30S, ...
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_dateinterval = null)
	
	/**
	 * set date interval values with PHP DateInterval object
	 *
	 * @param DateInterval $p_o_dateInterval
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function SetDateInterval(\DateInterval $p_o_dateInterval)
	
	/**
	 * returns date interval string with translation
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
							
						

forestDateTime.php

capsule class for creating DateTime-objects with own rules and easy uses

							
	/**
	 * constructor of forestDateTime class
	 *
	 * @param string $p_s_format  format string for DateTime
	 * @param integer $p_i_year
	 * @param integer $p_i_month
	 * @param integer $p_i_day
	 * @param integer $p_i_hour
	 * @param integer $p_i_minute
	 * @param integer $p_i_second
	 * @param string $p_o_timezone  timezone object
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_format = null, $p_i_year = 0, $p_i_month = 0 , $p_i_day = 0, $p_i_hour = 0, $p_i_minute = 0, $p_i_second = 0, $p_o_timezone = null)
	
	/**
	 * returns DateTime as string with format setting or DateTime::ATOM
	 *
	 * @return string  DateTime as string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * manual ToString-method for returning DateTime in another format than was set on creation of the object or DateTime::ATOM
	 *
	 * @param string $p_s_format  format string for DateTime
	 *
	 * @return string  DateTime as string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ToString($p_s_format = null)
	
	/**
	 * add interval to DateTime value
	 *
	 * @param integer $p_i_years
	 * @param integer $p_i_months
	 * @param integer $p_i_days
	 * @param integer $p_i_hours
	 * @param integer $p_i_minutes
	 * @param integer $p_i_seconds
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function AddDateInterval($p_i_years = 0, $p_i_months = 0 , $p_i_days = 0, $p_i_hours = 0, $p_i_minutes = 0, $p_i_seconds = 0)
	
	/**
	 * sub interval from DateTime value
	 *
	 * @param integer $p_i_years
	 * @param integer $p_i_months
	 * @param integer $p_i_days
	 * @param integer $p_i_hours
	 * @param integer $p_i_minutes
	 * @param integer $p_i_seconds
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function SubDateInterval($p_i_years = 0, $p_i_months = 0 , $p_i_days = 0, $p_i_hours = 0, $p_i_minutes = 0, $p_i_seconds = 0)
	
	/**
	 * convert integer seconds to DateTime value
	 *
	 * @param integer $p_i_seconds
	 *
	 * @return forestDateTime
	 *
	 * @access public
	 * @static yes
	 */
	public static function SecondsToDateTime($p_i_seconds = 0)
	
	/**
	 * convert unix timestamp to DateTime value
	 *
	 * @param integer $p_i_unixTimestmp
	 *
	 * @return forestDateTime
	 *
	 * @access public
	 * @static yes
	 */
	public static function UnixTimestampToDateTime($p_i_unixTimestmp = 0)
	
	/**
	 * get amount of days of a month, considering leap year too
	 *
	 * @param integer $p_i_month
	 * @param integer $p_i_year
	 *
	 * @return integer
	 *
	 * @access public
	 * @static yes
	 */
	public static function AmountDaysMonth($p_i_month = 0, $p_i_year = 0)
	
	/**
	 * check if year is a leap year
	 *
	 * @param integer $p_i_year
	 *
	 * @return bool  true - is leap year, false - is not leap year
	 *
	 * @access public
	 * @static yes
	 */
	public static function LeapYear($p_i_year = 0)
							
						

forestException.php

class for own exceptions getting exception-description from database table
distinguish between three exception types: error, warnung, message - all three types have their own ToString-behaviour

							
	/**
	 * constructor of forestException class, set exception content, dynamic values and error trigger flag
	 *
	 * @param object $p_o_content  exception content message
	 * @param array $p_a_values  array of values which should be inserted into exception message by sprintf2 helper function, usually dynamic values
	 * @param bool $p_b_triggerError  flag to use trigger_error php function
	 *
	 * @return object of type Exception
	 *
	 * @access public
	 * @static no
	 */
	public function __construct($p_o_content = null, $p_a_values = array(), $p_b_triggerError = false)
	
	/**
	 * __toString function returning created exception as string value, well formated
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
							
						

forestFile.php

file class for creating and editing files on your own webspace

							
	/**
	 * access to amount of file lines
	 *
	 * @return integer  amount of file lines
	 *
	 * @access public
	 * @static no
	 */
	public function FileLines()
	
	/**
	 * constructor of forestFile class to read or create a file
	 *
	 * @param string $p_s_fullfilename  filename with full path
	 * @param bool $p_b_new  true - create new file, false - read file
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_fullfilename, $p_b_new = false)
	
	/**
	 * delete file which was opened by creating forestFile
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function DeleteFile()
	
	/**
	 * read a line from the file
	 *
	 * @param integer $p_i_line  file line number
	 *
	 * @return string  file line as string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ReadLine($p_i_line = 0)
	
	/**
	 * wrote a line to the file
	 *
	 * @param string $p_s_value  new file line as string
	 * @param integer $p_i_line  file line number
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function WriteLine($p_s_value, $p_i_line = 0)
	
	/**
	 * replace a line in the file
	 *
	 * @param string $p_s_value  new file line as string
	 * @param integer $p_i_line  file line number
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ReplaceLine($p_s_value, $p_i_line)
	
	/**
	 * delete a line from the file
	 *
	 * @param integer $p_i_line  file line number
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function DeleteLine($p_i_line)
	
	/**
	 * replace full content of the file
	 *
	 * @param string $p_s_value  file content as string
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ReplaceContent($p_s_value)
	
	/**
	 * truncate full content of the file
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function TruncateContent()
	
	/**
	 * create csv file in temporary directory with file name and random name suffix
	 *
	 * @param string $p_s_name  name of file which should be created
	 *
	 * @return string  filename of generate csv file
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static yes
	 */
	public static function CreateTempFileCSV($p_s_name)
	
	/**
	 * create forestPHP file folder structure
	 *
	 * @param string $p_s_branch  name of branch where folder structure should be created
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static yes
	 */
	public static function CreateFileFolderStructure($p_s_branch)
	
	/**
	 * remove a directory and all its sub-directories and files
	 *
	 * @param string $p_s_directory  path to directory
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function RemoveDirectoryRecursive($p_s_directory)
	
	/**
	 * copy a directory and all its sub-directories and files to a destination directory
	 *
	 * @param string $p_s_srcDirectory  path to source directory
	 * @param string $p_s_dstDirectory  path to destination directory
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function CopyRecursive($p_s_srcDirectory, $p_s_dstDirectory)
							
						

forestForm.php

class-collection for all necessary form data and settings
multiple tabs are possible for rendering, also modal form view is supported
most settings are based on json encoded strings stored in configuration files or in database records

							
class forestForm {
	/**
	 * constructor of forestForm class
	 *
	 * @param forestTwig $p_o_twig  forestTwig object to get tablefields and information to render the form for each tablefield
	 * @param bool $p_b_automatic  true - create a new forestForm object and generate form elements by twig object automtically, false - only create a new forestForm object
	 * @param bool $p_b_readonly  true - indicates that the form is in readonly mode, false - normal form
	 * @param bool $p_b_printFooter  true - indicates that the form has a footer, false - form has no footer
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct(\fPHP\Twigs\forestTwig $p_o_twig, $p_b_automatic = false, $p_b_readonly = false, $p_b_printFooter = true)
	
	/**
	 * render the complete form with all its settings
	 *
	 * @return string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * create standard modal form elements, by loading standard form formElement, submit and cancel button
	 *
	 * @param forestTwig $p_o_twig
	 * @param string $p_s_title  title of form
	 * @param bool $p_b_showSubmit  true - create submit button, false - do not create submit button
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function CreateModalForm(\fPHP\Twigs\forestTwig $p_o_twig, $p_s_title, $p_b_showSubmit = true)
	
	/**
	 * create standard delete modal form elements, by loading standard form formElement, submit and cancel button
	 *
	 * @param forestTwig $p_o_twig
	 * @param string $p_s_title  title of form
	 * @param string $p_s_description  description for delete form
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function CreateDeleteModalForm(\fPHP\Twigs\forestTwig $p_o_twig, $p_s_title, $p_s_description)
	
	/**
	 * add hidden form key field to form footer elements
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function AddFormKey()
	
	/**
	 * get form element by form element id
	 *
	 * @param string $p_s_formId
	 *
	 * @return forestFormElement
	 *
	 * @access public
	 * @static no
	 */
	public function GetFormElementByFormId($p_s_formId)
	
	/**
	 * delete form element by form element id
	 *
	 * @param string $p_s_formId
	 *
	 * @return bool  true - form element has been deleted, false - form element has been not found
	 *
	 * @access public
	 * @static no
	 */
	public function DeleteFormElementByFormId($p_s_formId)
	
	/**
	 * add form element to form
	 *
	 * @param forestFormElement $p_o_formElement
	 * @param string $p_s_tabId  indicated on which tab the form element should be added
	 * @param bool $p_b_first  true - add as first element, false - just add to form element list
	 *
	 * @return bool  true - form element has been added, false - form element has been not added
	 *
	 * @access public
	 * @static no
	 */
	public function AddFormElement(\fPHP\Forms\forestFormElement $p_o_formElement, $p_s_tabId = 'general', $p_b_first = false)
}
	
class forestFormTab {
	/**
	 * constructor of forestFormTab class
	 *
	 * @param string $p_s_tabId  tab id for html tab element
	 * @param string $p_s_tabTitle  tab title for html tab element
	 * @param string $p_s_tabClass  tab class for html tab element
	 * @param string $p_b_printFooter  tab active class for html tab element
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_tabId = null, $p_s_tabTitle = null, $p_s_tabClass = null, $p_s_tabActiveClass = null)
	
	/**
	 * render the complete form tab with all its settings
	 *
	 * @return string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * load forestFormTab class with settings from json object
	 *
	 * @param string $p_s_jsonDataSettings  json settings
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function loadJSON($p_s_jsonDataSettings)
	
	/**
	 * check if all necessary settings for forestFormTab are set
	 *
	 * @param boool $p_b_extended  true - check tab class and tab active class, false - check only tab id and tab title
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function CheckIsset($p_b_extended = false)
	
	/**
	 * get form element by form element id
	 *
	 * @param string $p_s_formId
	 *
	 * @return forestFormElement
	 *
	 * @access public
	 * @static no
	 */
	public function GetFormElementByFormId($p_s_formId)
	
	/**
	 * delete form element by form element id
	 *
	 * @param string $p_s_formId
	 *
	 * @return bool  true - form element has been deleted, false - form element has been not found
	 *
	 * @access public
	 * @static no
	 */
	public function DeleteFormElementByFormId($p_s_formId)
	
	/**
	 * add form element to form
	 *
	 * @param forestFormElement $p_o_formElement
	 * @param bool $p_b_first  true - add as first element, false - just add to form element list
	 *
	 * @return bool  true - form element has been added, false - form element has been not added
	 *
	 * @access public
	 * @static no
	 */
	public function AddFormElement(\fPHP\Forms\forestFormElement $p_o_formElement, $p_b_first = false)
}
							
						

forestFormElement.php

class collection for rendering all usable html form elements
all necessary properties can be changed and will be considered in the __toString-methods
its a full collection of these properties

							
class forestFormElement {
	/**
	 * access to forestFormElement type value
	 *
	 * @return string  forestFormElement type
	 *
	 * @access public
	 * @static no
	 */
	public function getType()
	
	/**
	 * access to forestFormElement formelement value
	 *
	 * @return forestFormElement
	 *
	 * @access public
	 * @static no
	 */
	public function getFormElement()
	
	/**
	 * constructor of forestFormElement class
	 *
	 * @param string $p_s_type  string value as constant pointer to desired form elements
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_type)
	
	/**
	 * render form element
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * bridge function to access form element properties
	 *
	 * @param string $p_s_name  name of property
	 *
	 * @return forestFormElement Property
	 *
	 * @access public
	 * @static no
	 */
	public function __get($p_s_name)
	
	/**
	 * bridge function to set form element properties
	 *
	 * @param string $p_s_name  name of property
	 * @param object $p_o_value  property value
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __set($p_s_name, $p_o_value)
	
	/**
	 * load forestFormElement class with settings from json object
	 *
	 * @param string $p_s_jsonDataSettings  json settings
	 * @param integer $p_i_branchId  deviating branch id
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function loadJSON($p_s_jsonDataSettings, $p_i_branchId = null)
	
	/**
	 * replace forestFormElement json settings text placeholders with translation values
	 *
	 * @param string $p_s_jsonDataSettings  json settings, passed by reference
	 * @param integer $p_i_branchId  deviating branch id
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function JSONSettingsMultilanguage(&$p_s_jsonDataSettings, $p_i_branchId = null)
}

abstract class forestFormGeneralAttributes
abstract class forestFormInputAttributes extends forestFormGeneralAttributes
class forestFormValidationRule
class forestFormObject extends forestFormGeneralAttributes
class forestFormElementText extends forestFormInputAttributes
class forestFormElementList extends forestFormInputAttributes
class forestFormElementHidden extends forestFormInputAttributes
class forestFormElementPassword extends forestFormInputAttributes
class forestFormElementFile extends forestFormInputAttributes
class forestFormElementRadio extends forestFormInputAttributes
class forestFormElementCheckbox extends forestFormInputAttributes
class forestFormElementColor extends forestFormInputAttributes
class forestFormElementEmail extends forestFormInputAttributes
class forestFormElementUrl extends forestFormInputAttributes
class forestFormElementDate extends forestFormInputAttributes
class forestFormElementDateTimeLocal extends forestFormInputAttributes
class forestFormElementMonth extends forestFormInputAttributes
class forestFormElementNumber extends forestFormInputAttributes
class forestFormElementRange extends forestFormInputAttributes
class forestFormElementSearch extends forestFormInputAttributes
class forestFormElementPhone extends forestFormInputAttributes
class forestFormElementTime extends forestFormInputAttributes
class forestFormElementWeek extends forestFormInputAttributes
class forestFormElementTextArea extends forestFormGeneralAttributes
class forestFormElementSelect extends forestFormGeneralAttributes
class forestFormElementDescription extends forestFormGeneralAttributes
class forestFormElementButton extends forestFormInputAttributes
class forestFormElementDropzone extends forestFormGeneralAttributes
class forestFormElementRichtext extends forestFormGeneralAttributes
class forestFormElementCaptcha extends forestFormInputAttributes
							
						

forestGlobals.php

singleton class for temporary values and communication
between different classes and build-steps in the script collection

							
	/**
	 * constructor of forestGlobals class
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * method to create singleton object
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function init()
	
	/**
	 * prevent cloning singleton object
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __clone()
	
	/**
	 * get forestSort object stored in global list by key
	 *
	 * @param string $p_s_key  index of forestSort object
	 *
	 * @return forestSort
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetSort($p_s_key)
	
	/**
	 * backup forestSort object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function BackupSorts()
	
	/**
	 * restore forestSort object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function RestoreSorts()
	
	/**
	 * backup forestLimit object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function BackupLimit()
	
	/**
	 * restore forestLimit object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function RestoreLimit()
	
	/**
	 * backup stdclass object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function BackupTemp()
	
	/**
	 * restore stdclass object list
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function RestoreTemp()
	
	/**
	 * build a tree of the branch-structure which is often used by functions and navigation processes
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function BuildBranchTree()
	
	/**
	 * this method is very important to get access to other classes which are not in the current url directory
	 * after this method has been called you can try to call a class which is in the parameter's branch url directory
	 *
	 * @param string $p_s_branch  name of branch
	 * @param string $p_s_action  name of action
	 * @param array $p_a_parameters  parameters array object
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function SetVirtualTarget($p_s_branch, $p_s_action = null, $p_a_parameters = null)
	
	/**
	 * load all translations from database
	 * thus it is not necessary to query always the database for each label, text, etc.
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ListTranslations()
	
	/**
	 * get a translation by name
	 *
	 * @param string $p_s_name  key name of translation
	 * @param integer $p_i_branch_id  id of branch
	 *
	 * @return string  translation string or NO_CAPTION
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetTranslation($p_s_name, $p_i_branch_id = null)
	
	/**
	 * load all table records from database
	 * load all table records with tablefields from database
	 * query all sub-constraints from database
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ListTables()
	
	/**
	 * fast access to a tablefield entry in global dictionary by tablefield uuid
	 *
	 * @return forestTAbleFieldProperties  fPHP-class with many information to a tablefield
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetTablefieldsDictionaryByUUID($p_s_uuid)
							
						

forestIterator.php

iterator class for forestObjectList-class
necessary for iteration of a list-objects in a foreach-loop

							
	/**
	 * constructor of forestIterator class
	 *
	 * @param array $p_a_value  array object
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
    public function __construct($p_a_value)
	
	/**
	 * set index back to zero
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
    public function rewind()
	
	/**
	 * get current array object based on internal index value using keys of array
	 *
	 * @return object
	 *
	 * @access public
	 * @static no
	 */
    public function current()
	
	/**
	 * get current key based on internal index value
	 *
	 * @return object  key value
	 *
	 * @access public
	 * @static no
	 */
    public function key()
	
	/**
	 * get next array object based on internal index value using keys of array
	 *
	 * @return object  object value if there is a next object, false if there is no next object in list
	 *
	 * @access public
	 * @static no
	 */
    public function next()
	
	/**
	 * check if there is a valid object behind a key
	 *
	 * @return bool  true - object set behind key, false - no object set behind key
	 *
	 * @access public
	 * @static no
	 */
    public function valid()
							
						

forestLimit.php

class for holding information about page limit of current page view

							
	/**
	 * constructor of forestLimit class
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * returns limit pagination
	 *
	 * @return string  html limit pagination element
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
							
						

forestLookupData.php

class to capsulate lookup result data
storing these objects in a global dictionary will reduce database record access for one session

							
	/**
	 * constructor of forestLookupData class
	 *
	 * @param string $p_s_table  name of table
	 * @param array $p_a_primary  primary key fields
	 * @param array $p_a_label  tablefields which will be shown if lookup will be read an isset
	 * @param array $p_a_filter  filter commands - syntax: 'FieldName' => 'FieldValue' or '!1FieldName' => 'FieldValue', '!2FieldName' => 'FieldValue', '!3FieldName' => 'FieldValue'
	 * @param string $p_s_concat  conat string how the label fields will be glued together
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_table, array $p_a_primary, array $p_a_label, array $p_a_filter = array(), $p_s_concat = ' - ')
	
	/**
	 * function call to overwrite lookup data
	 *
	 * @param string $p_s_functionName  name of function
	 * @param array $p_a_arguments  argument object which must be of type forestLookupData
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __call($p_s_functionName, $p_a_arguments)
	
	/**
	 * return field values of label fields in settings with concat string setting
	 * result wiill be stored in global dictionary, so that it must not be queried again
	 *
	 * @return string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * this function is important to use lookup data with web select control or other option based controls
	 *
	 * @return array  options array with syntax array('label fields with concat string setting' => 'primary key'
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function CreateOptionsArray()
							
						

forestMaintenance.php

maintenance routine if any main exception occurs during runtime

forestNavigation.php

class for render the navigation-bar
the navigation-bar itself is a linked list of navigation-nodes

							
	/**
	 * constructor of forestNavigation class
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * initialisation function to get navigation settings from database and creation of all navigation nodes
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function InitNavigation()
	
	/**
	 * main render function
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function RenderNavigation()
	
	/**
	 * function to render a landing page
	 *
	 * @return string  contains all html nodes to show a landing page
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function RenderLandingPage()
							
						

forestNavigationNode.php

class holding navigation information
action and parameter properties are not necessary to be set at this point of development

							
	/**
	 * constructor of forestNavigationNode class
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * function to render navigation node for landing page
	 *
	 * @return string  navigation node
	 *
	 * @access public
	 * @static no
	 */
	public function RenderForLandingPage()
	
	/**
	 * function to render navigation node
	 *
	 * @return string  navigation node
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
							
						

forestObjectList.php

simple class for using collections
creating lists of objects with array, index can be of any type

							
	/**
	 * property function count
	 *
	 * @return integer  amount of objects in list
	 *
	 * @access public
	 * @static no
	 */
	public function Count()
	
	/**
	 * property function firstkey to get the first element by sorting keys with array_keys
	 *
	 * @return object  first object in list
	 *
	 * @access public
	 * @static no
	 */
	public function FirstKey()
	
	/**
	 * property function lastkey to get the last element by sorting keys with array_keys
	 *
	 * @return object  last object in list
	 *
	 * @access public
	 * @static no
	 */
	public function LastKey()
	
	/**
	 * on initializing the object-list, we need the class-name of the object
	 * so we can be sure in our list are only objects of the same type/class later
	 *
	 * @param string $p_s_objectClassName  class name of objects which will be accepted to be added to the list
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_objectClassName)
	
	/**
	 * add an object to array list
	 * controlling the class-name to be sure in array list are only objects of the same type/class
	 *
	 * @param object $p_o_object  object which will be stored in list
	 * @param string $p_s_key  key name for index, optional
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function Add($p_o_object, $p_s_key = null)
	
	/**
	 * add an object to array list as first element
	 * controlling the class-name to be sure in array list are only objects of the same type/class
	 *
	 * @param object $p_o_object  object which will be stored in list
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function AddFirst($p_o_object)
	
	/**
	 * delete an object in the list
	 * controlling that the element exists in array list
	 *
	 * @param string $p_s_key  key name for index, optional
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function Del($p_s_key = null)
	
	/**
	 * using magic method to get array list object or for iteration in a foreach-loop
	 *
	 * @param string $p_s_key  key name for index, optional
	 *
	 * @return object  object in list found by index key
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __get($p_s_key = null)
	
	/**
	 * method to find out if object exists by key
	 *
	 * @param string $p_s_key  key name for index
	 *
	 * @return bool  true - object exists in list, false - object does not exists in list
	 *
	 * @access public
	 * @static no
	 */
	public function Exists($p_s_key)
	
	/**
	 * method to find out if array has element equal to parameter value
	 *
	 * @param object $p_o_value  object for comparsion
	 *
	 * @return bool  true - object exists in list, false - object does not exists in list
	 *
	 * @access public
	 * @static no
	 */
	public function Has($p_o_value)
	
	/**
	 * abstract necessary method from IteratorAggregate-Interface to create an external Iterator
	 *
	 * @return forestIterator  instance of forestIterator to loop through list
	 *
	 * @access public
	 * @static no
	 */
	public function getIterator()
	
	/**
	 * method to sort objects in the list, by using an individual function named CompareObjects
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function SortObjects()
							
						

forestPHP.php

central control class of forestPHP framework for fetch-content and render-content

							
	/**
	 * constructor of forestPHP framework
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * init function to separate fetching content and rendering output of forestPHP framework
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function init()
							
						

forestRootBranch.php

adminisration class for handling all adminstrative use cases for forestBranch and forestTwig objects

							
	/**
	 * render root menu for root actions for every branch
	 *
	 * @return string  string value with root menu part for navigation
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function RenderRootMenu()
	
	/**
	 * handle new branch record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newBranchAction()
	
	/**
	 * handle edit branch record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editBranchAction()
	
	/**
	 * handle view branch record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function viewBranchAction()
	
	/**
	 * handle action to change order of branch record in navigation, moving one record up
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveUpBranchAction()
	
	/**
	 * handle action to change order of branch record in navigation, moving one record down
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveDownBranchAction()
	
	/**
	 * handle delete branch record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteBranchAction()


	/**
	 * handle new action record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newActionAction()

	/**
	 * handle edit action record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editActionAction()
	
	/**
	 * handle delete action record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteActionAction()


	/**
	 * handle new twig record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newTwigAction()

	/**
	 * handle edit twig record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editTwigAction()
	
	/**
	 * handle view twig record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function viewTwigAction()
	
	
	/**
	 * truncate execution of a twig
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table which will be truncated
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function executeTruncateTwig(\fPHP\Twigs\tableTwig $p_o_table)
	
	/**
	 * handle delete twig record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteTwigAction()
	
	/**
	 * handle sub records display in detail view
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table where all properties will be queried and shown within a modal form
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function ListTwigProperties(\fPHP\Twigs\tableTwig $p_o_twig)
	
	/**
	 * function to update twig file of current branch with current tablefields and twig settings
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table to update the twig file in ./twigs/
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function doTwigFile(\fPHP\Twigs\tableTwig $p_o_tableTwig)
	
	
	/**
	 * handle new twig tablefield record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newTwigFieldAction()
	
	/**
	 * handle edit twig tabelfield record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editTwigFieldAction()
	
	/**
	 * handle delete twig tabelfield record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteTwigFieldAction()
	
	/**
	 * check twigfield relation to other elements
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table
	 * @param tablefieldTwig $p_o_tablefield  tablefield record of table sys_fphp_tablefield
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function checkTwigFieldBeforeDeletion(\fPHP\Twigs\tableTwig $p_o_table, \fPHP\Twigs\tablefieldTwig $p_o_tablefield)
	
	/**
	 * check twigfield relation to other elements
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table, passed by reference
	 * @param tablefieldTwig $p_o_tablefield  tablefield record of table sys_fphp_tablefield
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function cleanupTwigFieldAfterDeletion(\fPHP\Twigs\tableTwig &$p_o_table, \fPHP\Twigs\tablefieldTwig $p_o_tablefield)
	
	/**
	 * handle action to change order of twig tablefield records, moving one record up
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveUpTwigFieldAction()
	
	/**
	 * handle action to change order of twig tablefield records, moving one record down
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveDownTwigFieldAction()
	
	/**
	 * handle view twig tablefield record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function viewTwigFieldAction()
	
	/**
	 * handle new translation record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newTranslationAction()

	/**
	 * handle edit translation record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editTranslationAction()
	
	/**
	 * handle delete translation record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteTranslationAction()


	/**
	 * handle new unique record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newUniqueAction()

	/**
	 * handle edit unique record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editUniqueAction()
	
	/**
	 * handle delete unique record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteUniqueAction()


	/**
	 * handle new sort order record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newSortAction()

	/**
	 * handle edit sort order record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editSortAction()
	
	/**
	 * handle delete sort order record action for twig
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteSortAction()


	/**
	 * handle new twig sub constraint record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newSubConstraintAction()

	/**
	 * handle edit twig sub constraint record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editSubConstraintAction()
	
	/**
	 * handle action to change order of sub constraint records, moving one record up
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveUpSubConstraintAction()
	
	/**
	 * handle action to change order of sub constraint records, moving one record down
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function moveDownSubConstraintAction()
	
	/**
	 * handle delete twig sub constraint record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteSubConstraintAction()

	/**
	 * check twigfield relation to other elements
	 *
	 * @param tableTwig $p_o_table  table record of table sys_fphp_table
	 * @param subconstraintTwig $p_o_subconstraint  sub contraint record of table sys_fphp_subcontraint
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function checkSubConstraintBeforeDeletion(\fPHP\Twigs\tableTwig $p_o_table, \fPHP\Twigs\subconstraintTwig $p_o_subconstraint)
	
	
	/**
	 * handle new twig validation rule record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function newValidationRuleAction()

	/**
	 * handle edit twig validation rule record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function editValidationRuleAction()
	
	/**
	 * handle delete twig validation rule record action
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access protected
	 * @static no
	 */
	protected function deleteValidationRuleAction()
							
						

forestSecurity.php

main class for security information
holding session values, user information, user rights and static functions for fphp framework security

							
	/**
	 * constructor of forestSecurity class
	 *
	 * @param bool $p_b_debug  flag to show debug information
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_b_debug = false)
	
	/**
	 * init function of forestSecurity class, handling session records, guest and user access
	 *
	 * @param bool $p_b_debug  flag to show debug information
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function init($p_b_debug = false)
	
	/**
	 * synchronize data in object list with $_SESSION array
	 *
	 * @param bool $p_b_debug  flag to show debug information
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function SyncSessionData($p_b_debug = false)
	
	/**
	 * logout function and cleanup
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function Logout()
	
	/**
	 * delete expired guest and user session records
	 *
	 * @param bool $p_b_debug  flag to show debug information
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function DeleteExpiredSessions($p_b_debug = false)
	
	/**
	 * generates uuid with php-function uniqid and '-'-delimiter
	 *
	 * @return string  uuid as string value
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GenUUID()
	
	/**
	 * generates random hash string
	 *
	 * @return string  random hash string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GenRandomHash()
	
	/**
	 * generates hash string with sha512-algorithm
	 *
	 * @return string  random hash string
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function HashString(&$p_s_value, $p_s_salt, $p_i_loop)
	
	/**
	 * generates random character for captcha image
	 *
	 * @param integer $p_i_strength  how many times a random character should be generated with mt_rand function
	 *
	 * @return char  random character
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GenerateCaptchaCharacter($p_i_strength = 10)
							
						

forestSort.php

class for holding information about sorting columns of current page view

							
	/**
	 * constructor of forestSort class
	 *
	 * @param string $p_s_column  name of sql column/field
	 * @param bool $p_b_direction  true - ascending, false - descending
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_column, $p_b_direction)
	
	/**
	 * returns sort link button
	 *
	 * @return string  html sort link button
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * alternative call of returning sort link with title parameter
	 *
	 * @return string  html sort link button
	 *
	 * @access public
	 * @static no
	 */
	public function ToString($p_s_columnName)
							
						

forestSQLQuery.php

class collection for generating one SQL-Query in an object-oriented way
this helps for object-oriented access on database-tables
for more information please read the documentation

							
	class forestSQLQuery
	
	/**
	 * constructor of forestSQLQuery class, set query parameters like base-gateway, type and table
	 *
	 * @param string $p_s_baseGateway  base-gateway constant
	 * @param string $p_s_type  type of sql query - SELECT, INSERT, UPDATE, DELETE, TRUNCATE, CREATE, DROP, ALTER
	 * @param string $p_s_table  table name
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_baseGateway, $p_s_type, $p_s_table)
	
	/**
	 * __toString function returning created sql query as string value
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
	
	/**
	 * function to get sql query object
	 *
	 * @return forestSQLQueryAbstract or forestString
	 *
	 * @access public
	 * @static no
	 */
	public function GetQuery()
	
	/**
	 * function to set sql query as string value manually
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function SetQuery($p_s_queryString)
	
	/**
	 * transpose general column type to base-gateway defined column type and further information for query execution
	 *
	 * @param string $p_s_baseGateway  base-gateway constant
	 * @param string $p_s_sqlType  type of sql column, based on values in table sys_fphp_sqltype
	 * @param string $p_s_columnType  transposed column type, passed by reference
	 * @param integer $p_i_columnLength  transposed column length, passed by reference
	 * @param integer $p_i_columnDecimalLength  transposed column decimal length, passed by reference
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static yes
	 */
	public static function ColumnTypeAllocation($p_s_baseGateway, $p_s_sqlType, &$p_s_columnType, &$p_i_columnLength, &$p_i_columnDecimalLength)
	
	/**
	 * transpose general constraint type to base-gateway defined constraint type and further information for query execution
	 *
	 * @param string $p_s_baseGateway  base-gateway constant
	 * @param string $p_s_constraintType  constraint type of sql column
	 * @param string $p_s_outConstraintType  transposed constraint type, passed by reference
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static yes
	 */
	public static function ConstraintTypeAllocation($p_s_baseGateway, $p_s_constraintType, &$p_s_outConstraintType)
	
	abstract class forestSQLQueryAbstract
	
	/**
	 * important parsing function, preventing SQL-Injection, formatting date values, etc
	 *
	 * @param string $p_s_value  value of a sql field/column
	 *
	 * @return string  returning checked and edited sql field/column value
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ParseValue($p_s_value)
	
	class forestSQLSelect
	class forestSQLInsert
	class forestSQLUpdate
	class forestSQLDelete
	class forestSQLTruncate
	class forestSQLCreate
	class forestSQLDrop
	class forestSQLAlter
	class forestSQLColumn
	class forestSQLJoin
	class forestSQLRelation
	class forestSQLWhere
	class forestSQLOrderBy
	class forestSQLLimit
	class forestSQLColumnValue
	class forestSQLColumnStructure
	class forestSQLConstraint
							
						

forestStringLib.php

collection of static string helper functions

							
	/**
	 * replace multiple values in a string where we have numeric placeholders with a preceding character
	 *
	 * @param string $p_s_str  string value with numeric placeholders
	 * @param array $p_a_vars  array of values
	 * @param char $p_s_char  numeric placeholder char for recognition
	 *
	 * @return string
	 *
	 * @access public
	 * @static yes
	 */
	public static function sprintf2($p_s_str = '', $p_a_vars = array(), $p_s_char = '%')
	
	/**
	 * replace multiple chars in a string which are arranged in two parameter-arrays
	 *
	 * @param string $p_s_str  string value, passed by reference
	 * @param array $p_a_search  array of characters which should be replaced
	 * @param array $p_a_replace  array of characters which are replacing the found characters
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function ReplaceChar(&$p_s_str, array $p_a_search, array $p_a_replace)
	
	/**
	 * remove multiple chars in a string which are set in parameter-array
	 *
	 * @param string $p_s_str  string value
	 * @param array $p_a_search  array of characters which should be removed
	 *
	 * @return string
	 *
	 * @access public
	 * @static yes
	 */
	public static function RemoveChar($p_s_str, array $p_a_search)
	
	/**
	 * converts sql-filter arguments into sql-clauses-array for implementing filter in query
	 * example: =35&<2|>=5&1..5&2*|ab?d
	 *
	 * @param string $p_s_value  string value
	 *
	 * @return array  array of filter clauses
	 *
	 * @access public
	 * @static yes
	 */
	public static function SplitFilter($p_s_value)
	
	/**
	 * converts date/time/datetime-sql-string into forestDateTime object
	 *
	 * @param string $p_s_value  string value
	 *
	 * @return forestDateTime
	 *
	 * @access public
	 * @static yes
	 */
	public static function TextToDate($p_s_value)
	
	/**
	 * converts hex-value into integer
	 *
	 * @param string $p_s_value  string value
	 *
	 * @return integer
	 *
	 * @access public
	 * @static yes
	 */
	public static function HexToInt($p_s_value)
	
	/**
	 * converts integer into hex-value
	 *
	 * @param integer $p_i_value  integer value
	 *
	 * @return string
	 *
	 * @access public
	 * @static yes
	 */
	public static function IntToHex($p_i_value)
	
	/**
	 * check if a string starts with a specific order of characters
	 *
	 * @param string $p_s_str  string value
	 * @param string $p_s_search  search for occurence
	 *
	 * @return bool  true - string starts with search value, false - string start not with search value
	 *
	 * @access public
	 * @static yes
	 */
	public static function StartsWith($p_s_str, $p_s_search)
	
	/**
	 * check if a string ends with a specific order of characters
	 *
	 * @param string $p_s_str  string value
	 * @param string $p_s_search  search for occurence
	 *
	 * @return bool  true - string ends with search value, false - string ends not with search value
	 *
	 * @access public
	 * @static yes
	 */
	public static function EndsWith($p_s_str, $p_s_search)
	
	/**
	 * close all open html tags of the parameter string
	 *
	 * @param string $p_s_value  string value
	 *
	 * @return string
	 *
	 * @access public
	 * @static yes
	 */
	public static function closeHTMLTags($p_s_value)
	
	/**
	 * function to remove system prefix of sql table names
	 *
	 * @param string $p_s_table  name of table, passed by reference
	 *
	 * @return null
	 *
	 * @access public
	 * @static yes
	 */
	public static function RemoveTablePrefix(&$p_s_table)
	
	/**
	 * replace unicode escape sequence within a string
	 *
	 * @param string $p_s_string  string value
	 *
	 * @return string
	 *
	 * @access public
	 * @static yes
	 */
	public static function ReplaceUnicodeEscapeSequence($p_s_string)
							
						

forestTableFieldProperties.php

class to capsulate data about tablefields
storing these objects in a global dictionary will reduce database record access for one session

							
	/**
	 * constructor of forestTableFieldProperties class, holding all information of a sql column/field
	 *
	 * @param parameters based on the sql columns/fields of sys_fphp_tablefield table
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct(
		$p_s_uuid,
		$p_s_tableUUID,
		$p_s_fieldName,
		$p_s_tabId,
		$p_s_json,
		$p_b_footerElement,
		$p_s_subRecordField,
		$p_i_order,
		$p_s_formUUID,
		$p_s_formName,
		$p_s_formJSON,
		$p_s_sqlUUID,
		$p_s_sqlName,
		$p_s_fdataUUID,
		$p_s_fdataName
	)
							
						

forestTemplates.php

template class using to print standard data elements

							
	/**
	 * access to forestTemplate type value
	 *
	 * @return string  forestTemplate type
	 *
	 * @access public
	 * @static no
	 */
	public function getType()
	
	/**
	 * constructor of forestTemplates class
	 *
	 * @param string $p_s_type  string value as constant pointer to desired template
	 * @param array $p_a_placeHolders  array list of values which should be inserted into the template
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_type, $p_a_placeHolders = null)
	
	/**
	 * render method to print forestTemplate with values which should be inserted into template's content by sprintf2 helper function, usually dynamic values
	 *
	 * @return string
	 *
	 * @access public
	 * @static no
	 */
	public function __toString()
							
						

forestTwig.php

abstract class for all twig objects, one twig represents a table in a database
all necessary methods to read or manipulate data are implemented in this class
and can be used with every twig-object that stays for one table in the database

							
	/**
	 * constructor of forestTwig class, creating a twig object representing a table with all its information and a table record
	 *
	 * @param array $p_a_record  raw dataset of a record as an array
	 * @param integer $p_i_resultType  standard ASSOC - ASSOC, NUM, BOTH, OBJ, LAZY
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_a_record = array(), $p_i_resultType = \fPHP\Base\forestBase::ASSOC)
	
	/* every class which inherits forestTwig must implement init-function */
	abstract protected function init();
	
	/**
	 * execute sql query to get table field properties
	 *
	 * @param string $p_s_tableUUID  table uuid
	 * @param string $p_s_field  field name
	 *
	 * @return array  raw record data or null if no properties could be found
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static yes
	 */
	public static function QueryFieldProperties($p_s_tableUUID, $p_s_field)
	
	/**
	 * query sub records of a sub constraint
	 *
	 * @param subconstraintTwig $p_o_subconstraint  sub constraint record
	 * @param bool $p_b_overwrite  flag to overwrite information in global cache, standard false
	 *
	 * @return forestTwigList  record list of sub records
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function QuerySubRecords(\fPHP\Twigs\subconstraintTwig $p_o_subconstraint, $p_b_overwrite = false)
	
	/**
	 * fill Mapping array from forestTwig instance
	 *
	 * @param array $p_a_object_vars  list of class variables
	 *
	 * @return null
	 *
	 * @access protected
	 * @static no
	 */
	protected function fphp_FillMapping(array $p_a_object_vars)
	
	/**
	 * general method to get property field value, for sub records as well as for combination fields
	 *
	 * @param string $p_s_name  sql column/field name
	 *
	 * @return object  value behind sql column/field name of holded record
	 *
	 * @access public
	 * @static no
	 */
	public function GetFieldValue($p_s_name)
	
	/**
	 * general method to set property field value, for sub records as well
	 *
	 * @param string $p_s_name  sql column/field name
	 * @param object $p_o_value  object value for sql column/field
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function SetFieldValue($p_s_name, $p_o_value)
	
	/**
	 * if twig object is not empty, field value will be restored using record image
	 *
	 * @param string $p_s_name  sql column/field name
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function RestoreFieldValue($p_s_name)
	
	/**
	 * calculate value behind forestCombination field
	 *
	 * @param string $p_s_forestCombination  forestCombination command
	 *
	 * @return object  value behind forestCombination field, usually a string value
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function CalculateCombination($p_s_forestCombination)
	
	/**
	 * get record with values of primary key
	 *
	 * @param array $p_a_primaryValues  primary key values for where clause
	 *
	 * @return bool  true - record found and values loaded into fields, false - record could not be found
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetRecord(array $p_a_primaryValues)
	
	/**
	 * determine if current twig object is empty
	 *
	 * @return bool  true - record is not empty, false - record is empty
	 *
	 * @access public
	 * @static no
	 */
	public function IsEmpty()
	
	/**
	 * gets record with values of temporary other primary key
	 *
	 * @param array $p_a_primaryValues  primary key values for where clause
	 * @param array $p_a_primaryKeys  primary key names for where clause
	 *
	 * @return bool  true - record found and values loaded into fields, false - record could not be found
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetRecordPrimary(array $p_a_primaryValues, array $p_a_primaryKeys)
	
	/**
	 * showing all data fields of current twig object for log purposes
	 *
	 * @param bool $p_b_showViewFields  true - show fields in view object list, false - show fields in mapping object list
	 * @param bool $p_b_printBreak  true - print html-br-tag within return value, false - do not print html-br-tag within return value
	 *
	 * @return string  record fields with values
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function ShowFields($p_b_showViewFields = true, $p_b_printBreak = false)
	
	/**
	 * get first record of table
	 *
	 * @return bool  true - record found and values loaded into fields, false - record could not be found
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetFirstRecord()
	
	/**
	 * get last record of table
	 *
	 * @return bool  true - record found and values loaded into fields, false - record could not be found
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetLastRecord()
	
	/**
	 * get amount of records of current table or another table
	 *
	 * @param string $p_s_table  name of table, optional
	 * @param bool $p_b_unlimited  true - use filter and limit settings, false - ignore filter and limit settings
	 * @param bool $p_b_updateLimitAmount  true - update global limit amount value, false - do not update global limit amount value
	 *
	 * @return integer  amount of records
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetCount($p_s_table = null, $p_b_unlimited = false, $p_b_updateLimitAmount = false)
	
	/**
	 * get all records, depending on filter and limit parameters
	 *
	 * @param bool $p_b_unlimited  true - use filter and limit settings, false - ignore filter and limit settings
	 *
	 * @return result of function forestBase->FetchQuery
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetAllRecords($p_b_unlimited = false)
	
	/**
	 * get records based on view columns, depending on filter and limit parameters
	 *
	 * @param bool $p_b_unlimited  true - use filter and limit settings, false - ignore filter and limit settings
	 *
	 * @return result of function this->GetAllRecords
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function GetAllViewRecords($p_b_unlimited = false)
	
	/**
	 * insert record into table, with primary key fields optional
	 *
	 * @param bool $p_b_withPrimary  true - assume and set values for primary key, false - keep primary key values unchanged or let them handle by dbms
	 *
	 * @return integer  -1 - unique issue, 0 - could not create record, 1 - record creation successful
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function InsertRecord($p_b_withPrimary = false, $p_b_full = false)
	
	/**
	 * update record in table, you cannot modify primary key, with modify of unique fields optional
	 *
	 * @param bool $p_b_modifyUnique  true - assume and set values for unique fields, false - keep unique key fields unchanged or let them handle by dbms
	 *
	 * @return integer  -1 - unique issue, 0 - could not update record, 1 - record update successful
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function UpdateRecord($p_b_modifyUnique = true)
	
	/**
	 * delete record in table
	 *
	 * @return integer  0 - could not delete record, 1 - record deletion successful
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function DeleteRecord()
		
	/**
	 * truncate table
	 *
	 * @return integer  0 - could not truncate table, 1 - truncate of table successful
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function TruncateTable()
							
						

forestTwigList.php

object collection of unique twigs, objects of one single database record
you enter a sql query result on construction of the twig list
it will automatically create the twig objects depending on how many records are present in the query result

							
	/**
	 * constructor of forestTwigList class, creating a object list of forestTwig objects and possible join records
	 *
	 * @param string $p_s_table  name of table
	 * @param array $p_a_records  raw dataset of records as an array
	 * @param integer $p_i_resultType  standard ASSOC - ASSOC, NUM, BOTH, OBJ, LAZY
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function __construct($p_s_table, $p_a_records = array(), $p_i_resultType = \fPHP\Base\forestBase::ASSOC)
							
						

forestURL.php

class holding specific url information based on an arranged url-format
for more information about the arranged url-format, see the documentation

							
	/**
	 * constructor of forestURL class
	 *
	 * @return null
	 *
	 * @access public
	 * @static no
	 */
	public function __construct()
	
	/**
	 * retrieving detail information out of database based on information read out of url
	 *
	 * @param bool $p_b_show  flag to show debug information
	 *
	 * @return null
	 *
	 * @throws forestException if error occurs
	 * @access public
	 * @static no
	 */
	public function RetrieveInformationByURL($p_b_show = false)