I am having a lot of indecision on how exactly to approach key parts of this.
I have added query parameter class, and may be replacing the existing implementation (or not).
I decided to keep the naming system more simple by remove the query_ prefix of methods and variables provided by the database traits.
This may introduce naming conflicts that need to be reviewed and resolved.
public function __construct() {
parent::__construct();
- $this->query_name = NULL;
- $this->query_rename_to = NULL;
- $this->query_owner_to = NULL;
- $this->query_set_schema = NULL;
+ $this->name = NULL;
+ $this->rename_to = NULL;
+ $this->owner_to = NULL;
+ $this->set_schema = NULL;
$this->aggregate_signatures = NULL;
$this->order_by_signatures = NULL;
* Class destructor.
*/
public function __destruct() {
- unset($this->query_name);
- unset($this->query_rename_to);
- unset($this->query_owner_to);
- unset($this->query_set_schema);
+ unset($this->name);
+ unset($this->rename_to);
+ unset($this->owner_to);
+ unset($this->set_schema);
unset($this->aggregate_signatures);
unset($this->order_by_signatures);
*/
public function do_build() {
// the aggregate name is required.
- if (!is_string($this->query_name)) {
+ if (!is_string($this->name)) {
return new c_base_return_false();
}
$this->value = static::pr_QUERY_COMMAND;
- $this->value .= ' ' . $this->query_name;
+ $this->value .= ' ' . $this->name;
$aggregate_signatures = NULL;
if (!is_array($this->aggregate_modes) || empty($this->aggregate_modes)) {
unset($order_by_signatures);
}
- if (is_string($this->query_rename_to)) {
- $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::RENAME_TO . ' (' . $this->query_rename_to . ')';
+ if (is_string($this->rename_to)) {
+ $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::RENAME_TO . ' (' . $this->rename_to . ')';
}
- else if (is_string($this->query_owner_to_user_name)) {
- $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::OWNER_TO . ' (' . $this->query_owner_to_user_name . ')';
+ else if (is_string($this->owner_to_user_name)) {
+ $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::OWNER_TO . ' (' . $this->owner_to_user_name . ')';
}
- else if (is_string($this->query_set_schema)) {
- $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::SET_SCHEMA . ' (' . $this->query_set_schema . ')';
+ else if (is_string($this->set_schema)) {
+ $this->value .= ' ' . $aggregate_signatures . ' ' . c_database_string::SET_SCHEMA . ' (' . $this->set_schema . ')';
}
else {
unset($aggregate_signatures);
public function __construct() {
parent::__construct();
- $this->query_name = NULL;
- $this->query_rename_to = NULL;
- $this->query_owner_to = NULL;
- $this->query_set_schema = NULL;
+ $this->name = NULL;
+ $this->rename_to = NULL;
+ $this->owner_to = NULL;
+ $this->set_schema = NULL;
$this->refreh_version = NULL;
}
* Class destructor.
*/
public function __destruct() {
- unset($this->query_name);
- unset($this->query_rename_to);
- unset($this->query_owner_to);
- unset($this->query_set_schema);
+ unset($this->name);
+ unset($this->rename_to);
+ unset($this->owner_to);
+ unset($this->set_schema);
unset($this->refresh_version);
*/
public function do_build() {
// the collation name is required.
- if (!is_string($this->query_name)) {
+ if (!is_string($this->name)) {
return new c_base_return_false();
}
$this->value = static::pr_QUERY_COMMAND;
- $this->value .= ' ' . $this->query_name;
+ $this->value .= ' ' . $this->name;
if (is_bool($this->refresh_version)) {
if ($this->refresh_version) {
$this->value .= ' ' . c_database_string::REFRESH_VERSION;
}
}
- else if (is_string($this->query_rename_to)) {
- $this->value .= ' ' . $this->pr_QUERY_RENAME_TO . ' (' . $this->query_rename_to . ')';
+ else if (is_string($this->rename_to)) {
+ $this->value .= ' ' . $this->pr_QUERY_RENAME_TO . ' (' . $this->rename_to . ')';
}
- else if (is_string($this->query_owner_to_user_name)) {
- $this->value .= ' ' . $this->pr_QUERY_OWNER_TO . ' (' . $this->query_owner_to_user_name . ')';
+ else if (is_string($this->owner_to_user_name)) {
+ $this->value .= ' ' . $this->pr_QUERY_OWNER_TO . ' (' . $this->owner_to_user_name . ')';
}
- else if (is_string($this->query_set_schema)) {
- $this->value .= ' ' . $this->pr_QUERY_SET_SCHEMA . ' (' . $this->query_set_schema . ')';
+ else if (is_string($this->set_schema)) {
+ $this->value .= ' ' . $this->pr_QUERY_SET_SCHEMA . ' (' . $this->set_schema . ')';
}
else {
$this->value = NULL;
public function __construct() {
parent::__construct();
- $this->query_name = NULL;
- $this->query_rename_to = NULL;
- $this->query_owner_to = NULL;
- $this->query_set_schema = NULL;
+ $this->name = NULL;
+ $this->rename_to = NULL;
+ $this->owner_to = NULL;
+ $this->set_schema = NULL;
}
/**
* Class destructor.
*/
public function __destruct() {
- unset($this->query_name);
- unset($this->query_rename_to);
- unset($this->query_owner_to);
- unset($this->query_set_schema);
+ unset($this->name);
+ unset($this->rename_to);
+ unset($this->owner_to);
+ unset($this->set_schema);
parent::__destruct();
}
*/
public function do_build() {
// the collation name is required.
- if (!is_string($this->query_name)) {
+ if (!is_string($this->name)) {
return new c_base_return_false();
}
$this->value = static::pr_QUERY_COMMAND;
- $this->value .= ' ' . $this->query_name;
+ $this->value .= ' ' . $this->name;
- if (is_string($this->query_rename_to)) {
- $this->value .= ' ' . $this->pr_QUERY_RENAME_TO . ' (' . $this->query_rename_to . ')';
+ if (is_string($this->rename_to)) {
+ $this->value .= ' ' . $this->pr_QUERY_RENAME_TO . ' (' . $this->rename_to . ')';
}
- else if (is_string($this->query_owner_to_user_name)) {
- $this->value .= ' ' . $this->pr_QUERY_OWNER_TO . ' (' . $this->query_owner_to_user_name . ')';
+ else if (is_string($this->owner_to_user_name)) {
+ $this->value .= ' ' . $this->pr_QUERY_OWNER_TO . ' (' . $this->owner_to_user_name . ')';
}
- else if (is_string($this->query_set_schema)) {
- $this->value .= ' ' . $this->pr_QUERY_SET_SCHEMA . ' (' . $this->query_set_schema . ')';
+ else if (is_string($this->set_schema)) {
+ $this->value .= ' ' . $this->pr_QUERY_SET_SCHEMA . ' (' . $this->set_schema . ')';
}
else {
$this->value = NULL;
public function __construct() {
parent::__construct();
- $this->query_name = NULL;
- $this->query_rename_to = NULL;
- $this->query_owner_to = NULL;
- $this->query_set = NULL;
- $this->query_set_tablespace = NULL;
- $this->query_set_parameter = NULL;
- $this->query_set_value = NULL;
- $this->query_reset = NULL;
- $this->query_reset_parameter = NULL;
+ $this->name = NULL;
+ $this->rename_to = NULL;
+ $this->owner_to = NULL;
+ $this->set = NULL;
+ $this->set_tablespace = NULL;
+ $this->set_parameter = NULL;
+ $this->set_value = NULL;
+ $this->reset = NULL;
+ $this->reset_parameter = NULL;
$this->option = NULL;
}
* Class destructor.
*/
public function __destruct() {
- unset($this->query_name);
- unset($this->query_rename_to);
- unset($this->query_owner_to);
- unset($this->query_set);
- unset($this->query_set_tablespace);
- unset($this->query_set_parameter);
- unset($this->query_set_value);
- unset($this->query_reset);
- unset($this->query_reset_parameter);
+ unset($this->name);
+ unset($this->rename_to);
+ unset($this->owner_to);
+ unset($this->set);
+ unset($this->set_tablespace);
+ unset($this->set_parameter);
+ unset($this->set_value);
+ unset($this->reset);
+ unset($this->reset_parameter);
unset($this->option);
*/
public function do_build() {
// the database name is required.
- if (!is_string($this->query_name)) {
+ if (!is_string($this->name)) {
return new c_base_return_false();
}
$this->value = static::pr_QUERY_COMMAND;
- $this->value .= ' ' . $this->query_name;
+ $this->value .= ' ' . $this->name;
if ($this->option instanceof c_database_argument_database_option) {
$this->option->do_build_argument();
$this->value .= ' ' . $this->option->get_value_exact();
}
- else if (is_string($this->query_rename_to)) {
- $this->value .= ' ' . c_database_string::RENAME_TO . ' (' . $this->query_rename_to . ')';
+ else if (is_string($this->rename_to)) {
+ $this->value .= ' ' . c_database_string::RENAME_TO . ' (' . $this->rename_to . ')';
}
- else if (is_string($this->query_owner_to_user_name)) {
- $this->value .= ' ' . c_database_string::OWNER_TO . ' (' . $this->query_owner_to_user_name . ')';
+ else if (is_string($this->owner_to_user_name)) {
+ $this->value .= ' ' . c_database_string::OWNER_TO . ' (' . $this->owner_to_user_name . ')';
}
- else if (is_string($this->query_set_tablespace)) {
- $this->value .= ' ' . c_database_string::SET_TABLESPACE . ' (' . $this->query_set_tablespace . ')';
+ else if (is_string($this->set_tablespace)) {
+ $this->value .= ' ' . c_database_string::SET_TABLESPACE . ' (' . $this->set_tablespace . ')';
}
- else if (is_int($this->query_set)) {
- if ($this->query_set === e_database_set::TO) {
- if (is_null($this->query_set_parameter)) {
- $this->value .= ' ' . c_database_string::SET . ' ' . $this->query_set_parameter . ' ' . c_database_string::TO . ' ' . c_database_string::DEFAULT;
+ else if (is_int($this->set)) {
+ if ($this->set === e_database_set::TO) {
+ if (is_null($this->set_parameter)) {
+ $this->value .= ' ' . c_database_string::SET . ' ' . $this->set_parameter . ' ' . c_database_string::TO . ' ' . c_database_string::DEFAULT;
}
- else if (is_string($this->query_set_parameter) && is_string($this->query_set_value)) {
- $this->value .= ' ' . c_database_string::SET . ' ' . $this->query_set_parameter . ' ' . c_database_string::TO . ' ' . $this->query_set_value;
+ else if (is_string($this->set_parameter) && is_string($this->set_value)) {
+ $this->value .= ' ' . c_database_string::SET . ' ' . $this->set_parameter . ' ' . c_database_string::TO . ' ' . $this->set_value;
}
}
- else if ($this->query_set === e_database_set::EQUAL) {
- if (is_null($this->query_set_parameter)) {
- $this->value .= ' ' . c_database_string::SET . ' ' . $this->query_set_parameter . ' = ' . c_database_string::DEFAULT;
+ else if ($this->set === e_database_set::EQUAL) {
+ if (is_null($this->set_parameter)) {
+ $this->value .= ' ' . c_database_string::SET . ' ' . $this->set_parameter . ' = ' . c_database_string::DEFAULT;
}
- else if (is_string($this->query_set_parameter) && is_string($this->query_set_value)) {
- $this->value .= ' ' . c_database_string::SET . ' ' . $this->query_set_parameter . ' = ' . $this->query_set_value;
+ else if (is_string($this->set_parameter) && is_string($this->set_value)) {
+ $this->value .= ' ' . c_database_string::SET . ' ' . $this->set_parameter . ' = ' . $this->set_value;
}
}
- else if ($this->query_set == e_database_set::FROM_CURRENT) {
- if (is_string($this->query_set_parameter)) {
- $this->value .= ' ' . c_database_string::SET . ' ' . $this->query_set_parameter . ' = ' . c_database_string::FROM_CURRENT;
+ else if ($this->set == e_database_set::FROM_CURRENT) {
+ if (is_string($this->set_parameter)) {
+ $this->value .= ' ' . c_database_string::SET . ' ' . $this->set_parameter . ' = ' . c_database_string::FROM_CURRENT;
}
}
}
- else if (is_string($this->query_reset)) {
- if ($this->query_set === e_database_reset::PARAMETER) {
- if (is_string($this->query_set_parameter)) {
- $this->value .= ' ' . c_database_string::RESET . ' ' . $this->query_set_parameter;
+ else if (is_string($this->reset)) {
+ if ($this->set === e_database_reset::PARAMETER) {
+ if (is_string($this->set_parameter)) {
+ $this->value .= ' ' . c_database_string::RESET . ' ' . $this->set_parameter;
}
}
- else if ($this->query_set === e_database_reset::ALL) {
+ else if ($this->set === e_database_reset::ALL) {
$this->value .= ' ' . c_database_string::RESET . ' ' . c_database_string::ALL;
}
}
public function __construct() {
parent::__construct();
- $this->query_in_schema = NULL;
- $this->query_action = NULL;
- $this->query_option = NULL;
+ $this->in_schema = NULL;
+ $this->action = NULL;
+ $this->option = NULL;
$this->for_targets = NULL;
$this->abbreviated = NULL;
public function __destruct() {
parent::__destruct();
- unset($this->query_in_schema);
- unset($this->query_action);
+ unset($this->in_schema);
+ unset($this->action);
unset($this->abbreviated);
unset($this->option_grant);
if (is_null($index)) {
if (is_array($this->role_names)) {
- return c_bse_return_array::s_new($this->role_names);
+ return c_base_return_array::s_new($this->role_names);
}
}
else {
return new c_base_return_false();
}
- switch ($this->query_action) {
+ switch ($this->action) {
case e_database_action::_GRANT:
case e_database_action::_REVOKE:
break;
}
// [ IN SCHEMA schema_name [, ... ] ]
- if (is_array($this->query_in_schema) && !empty($this->query_in_schema)) {
+ if (is_array($this->in_schema) && !empty($this->in_schema)) {
$this->value .= ' ' . c_database_string::IN . ' ' . c_database_string::SCHEMA;
$names = NULL;
- foreach ($this->query_in_schema as $schema_name) {
+ foreach ($this->in_schema as $schema_name) {
$names .= ', ' . $schema_name;
}
unset($names);
}
- if ($this->query_action === e_database_action::ACTION_GRANT) {
+ if ($this->action === e_database_action::ACTION_GRANT) {
$this->value .= ' ' . c_database_string::GRANT;
}
- else if ($this->query_action === e_database_action::ACTION_REVOKE) {
+ else if ($this->action === e_database_action::ACTION_REVOKE) {
$this->value .= ' ' . c_database_string::REVOKE;
if ($this->option_grant) {
}
// [ TO | FROM ] ... role names ...
- if ($this->query_action === e_database_action::GRANT) {
+ if ($this->action === e_database_action::GRANT) {
$this->value .= ' ' . c_database_string::TO;
}
- else if ($this->query_action === e_database_action::REVOKE) {
+ else if ($this->action === e_database_action::REVOKE) {
$this->value .= ' ' . c_database_string::FROM;
}
}
unset($role_name);
- if ($this->query_action === e_database_action::GRANT) {
+ if ($this->action === e_database_action::GRANT) {
// [ WITH GRANT OPTION ]
if ($this->option_grant) {
$this->value .= ' ' . c_database_string::WITH_GRANT_OPTION;
}
}
- else if ($this->query_action === e_database_action::REVOKE) {
+ else if ($this->action === e_database_action::REVOKE) {
// [ CASCADE | RESTRICT ]
- if ($this->query_option === e_database_option::CASCADE) {
+ if ($this->option === e_database_option::CASCADE) {
$this->value .= ' ' . c_database_string::CASCADE;
}
- else if ($this->query_option === e_database_option::RESTRICT) {
+ else if ($this->option === e_database_option::RESTRICT) {
$this->value .= ' ' . c_database_string::RESTRICT;
}
}
require_once('common/database/enumerations/database_action.php');
require_once('common/database/enumerations/database_option.php');
-require_once('common/database/enumerations/database_property.php');
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
+require_once('common/database/traits/database_set_schema.php');
+require_once('common/database/traits/database_action.php');
+require_once('common/database/traits/database_option.php');
/**
* The class for building and returning a Postgresql ALTER DOMAIN query string.
use t_database_rename_to;
use t_database_set_schema;
use t_database_action;
- use t_database_property;
+ use t_database_action_property;
use t_database_option;
protected const pr_QUERY_COMMAND = 'alter domain';
public function __construct() {
parent::__construct();
- $this->query_name = NULL;
- $this->query_owner_to = NULL;
- $this->query_rename_to = NULL;
- $this->query_set_schema = NULL;
- $this->query_action = NULL;
- $this->query_action_property = NULL;
- $this->query_option = NULL;
+ $this->name = NULL;
+ $this->owner_to = NULL;
+ $this->rename_to = NULL;
+ $this->set_schema = NULL;
+ $this->action = NULL;
+ $this->action_property = NULL;
+ $this->option = NULL;
$this->expression = NULL;
$this->contraint = NULL;
* Class destructor.
*/
public function __destruct() {
- unset($this->query_name);
- unset($this->query_owner_to);
- unset($this->query_rename_to);
- unset($this->query_set_schema);
- unset($this->query_action);
- unset($this->query_action_property);
- unset($this->query_option);
+ unset($this->name);
+ unset($this->owner_to);
+ unset($this->rename_to);
+ unset($this->set_schema);
+ unset($this->action);
+ unset($this->action_property);
+ unset($this->option);
unset($this->expression);
unset($this->contraint);
* Implements do_build().
*/
public function do_build() {
- if (is_null($this->query_name)) {
+ if (is_null($this->name)) {
return new c_base_return_false();
}
$action = NULL;
- switch ($this->query_action) {
+ switch ($this->action) {
case e_database_action::ADD:
if (!is_string($this->constraint)) {
unset($action);
break;
case e_database_action::OWNER_TO:
- if (!is_string($this->query_owner_to_user_name)) {
+ if (!is_string($this->owner_to_user_name)) {
unset($action);
return new c_base_return_false();
}
- $action = c_database_string::OWNER_TO . ' (' . $this->query_owner_to_user_name . ')';
+ $action = c_database_string::OWNER_TO . ' (' . $this->owner_to_user_name . ')';
break;
case e_database_action::RENAME_CONSTRAINT:
break;
case e_database_action::RENAME_TO:
- if (!is_string($this->query_rename_to)) {
+ if (!is_string($this->rename_to)) {
unset($action);
return new c_base_return_false();
}
- $action = c_database_string::RENAME_TO . ' (' . $this->query_rename_to . ')';
+ $action = c_database_string::RENAME_TO . ' (' . $this->rename_to . ')';
break;
case e_database_action::SET:
break;
case e_database_action::SET_SCHEMA:
- if (!is_string($this->query_set_schema)) {
+ if (!is_string($this->set_schema)) {
unset($action);
return new c_base_return_false();
}
- $action = ' ' . c_database_string::SET_SCHEMA . ' (' . $this->query_set_schema . ')';
+ $action = ' ' . c_database_string::SET_SCHEMA . ' (' . $this->set_schema . ')';
break;
case e_database_action::VALIDATE_CONSTRAINT:
}
$this->value = static::pr_QUERY_COMMAND;
- $this->value .= ' ' . $this->query_name;
+ $this->value .= ' ' . $this->name;
$this->value .= ' ' . $action;
return new c_base_return_true();
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
+require_once('common/database/traits/database_action.php');
+require_once('common/database/traits/database_name.php');
+require_once('common/database/traits/database_owner_to.php');
+require_once('common/database/traits/database_rename_to.php');
/**
* The class for building and returning a Postgresql ALTER EVENT TRIGGER query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/base/classes/base_return.php');
require_once('common/database/interfaces/database_query.php');
+require_once('common/database/interfaces/database_query_parameter.php');
/**
* The base class for building and returning a Postgresql query string.
* SQL queries may be passed to other SQL queries, marking them as sub-queries.
* This will most commonly be added to other expressions.
*/
-class c_database_argument_query extends c_base_return_string implements i_database_argument {
+class c_database_argument_query extends c_base_return_string implements i_database_query_parameter {
protected $query;
/**
/**
* Provide an SQL expression argument.
*/
-class c_database_argument_expression extends c_base_return_string implements i_database_argument {
+class c_database_argument_expression extends c_base_return_string implements i_database_query_parameter {
protected const pr_QUERY_AS = 'as';
protected $expression;
* Expression are usually fields but also be other expressions.
* Expressions may even be SQL queries.
*
- * @param i_database_argument|null $expression
+ * @param i_database_query_parameter|null $expression
* The expression to assign.
* Set to NULL to remove the assigned expression.
*
return new c_base_return_true();
}
- if ($expression instanceof i_database_argument) {
+ if ($expression instanceof i_database_query_parameter) {
$this->expression = $expression;
return new c_base_return_true();
}
/**
* Get the assigned SQL expression.
*
- * @return i_database_argument|null
+ * @return i_database_query_parameter|null
* A valid query argument.
* NULL is returned if not assigned.
* NULL with the error bit set is returned on error.
return new c_base_return_null();
}
- if ($this->expression instanceof i_database_argument) {
+ if ($this->expression instanceof i_database_query_parameter) {
return clone($this->expression);
}
* This is essentially an aggregate_signature without the wildcard and ORDER BY support.
* The ORDER BY support can then utilize this base without having its own wildcard and ORDER BY.
*/
-class c_database_argument_aggregate_signature_base extends c_base_return_string implements i_database_argument {
+class c_database_argument_aggregate_signature_base extends c_base_return_string implements i_database_query_parameter {
public const QUERY_ARGUMENT_MODE_NONE = 0;
public const QUERY_ARGUMENT_MODE_IN = 1;
public const QUERY_ARGUMENT_MODE_VARIADIC = 2;
/**
* Provide an SQL argument database option.
*/
-class c_database_argument_database_option extends c_base_return_string implements i_database_argument {
+class c_database_argument_database_option extends c_base_return_string implements i_database_query_parameter {
protected $argument_allow_connection;
protected $argument_connection_limit;
protected $argument_is_template;
/**
* Provide an SQL role name base structure.
*/
-class c_database_argument_role_name extends c_base_return_string implements i_database_argument {
+class c_database_argument_role_name extends c_base_return_string implements i_database_query_parameter {
public const QUERY_ARGUMENT_MODE_NONE = 0;
public const QUERY_ARGUMENT_MODE_PUBLIC = 1;
public const QUERY_ARGUMENT_MODE_NAME = 2;
* @file
* Provides classes for specific Postgesql Queries Parameter support.
*
+ * @errata:
+ * There is a lot of indecision on how this is to be design/used.
+ * Query parameters are being provided as a possible solution and may be removed in the future.
+ * I need to sit down and review the design before coming to a decision.
+ * Until then, this is being provided as a possibility.
+ * That said, I am strongly considering having the SQL generation functions do the actual generation of the query parameters.
+ * All would leave to implement would be embeded queries, which would be handled by some aspect of this implementation.
+ * The query parameters (or something like that) is needed for sub-query support.
+ *
* @see: https://www.postgresql.org/docs/current/static/sql-commands.html
*/
namespace n_koopa;
require_once('common/base/classes/base_error.php');
require_once('common/base/classes/base_return.php');
-/**
- * An interface used to represent a Postgresql query parameter.
- *
- * The query parameter represents a placeholder to the assigned value (via the implementation of some specific subclass of c_base_return_value).
- * The placeholder is intended to be inserted into the query string so that something like PHP's PDO can safely convert the placeholder to a given value.
- * This does not store a placeholder name itself as the class itself represents that it is a placeholder.
- *
- * @see: c_base_return_value
- */
-interface i_database_query_parameter {
-
- /**
- * @see: c_base_return_value::p_s_new()
- */
- public static function s_new($value);
-
- /**
- * @see: c_base_return_value::p_s_value()
- */
- public static function s_value($return);
+require_once('common/database/interfaces/database_query_parameter.php');
- /**
- * @see: c_base_return_value::s_value_exact()
- */
- public static function s_value_exact($return);
-
- /**
- * @see: c_base_return_value::set_value()
- */
- public function set_value($value);
-
- /**
- * @see: c_base_return_value::get_value()
- */
- public function get_value();
-
- /**
- * @see: c_base_return_value::get_value_exact()
- */
- public function get_value_exact();
-}
+require_once('common/database/classes/database_query.php');
/**
- * A query parameter representing a boolean.
+ * A query parameter representing a string.
*
- * @see: c_base_return_bool
+ * @see: c_base_return_string
*/
-class c_database_query_parameter_bool extends c_base_return_bool implements i_database_query_parameter {
+class c_database_query_parameter extends c_base_return_string implements i_database_query_parameter {
/**
* @see: t_base_return_value::p_s_new()
* @see: t_base_return_value_exact::p_s_value_exact()
*/
public static function s_value_exact($return) {
- return self::p_s_value_exact($return, __CLASS__, FALSE);
+ return self::p_s_value_exact($return, __CLASS__, '');
}
}
/**
- * A query parameter representing a string.
+ * A query parameter representing a boolean.
*
- * @see: c_base_return_string
+ * @see: c_base_return_bool
*/
-class c_database_query_parameter_string extends c_base_return_string implements i_database_query_parameter {
+class c_database_query_parameter_bool extends c_base_return_bool implements i_database_query_parameter {
/**
* @see: t_base_return_value::p_s_new()
* @see: t_base_return_value_exact::p_s_value_exact()
*/
public static function s_value_exact($return) {
- return self::p_s_value_exact($return, __CLASS__, '');
+ return self::p_s_value_exact($return, __CLASS__, FALSE);
}
}
*
* @see: c_base_return_float
*/
-class c_database_query_parameter_float extends c_base_return_value implements i_database_query_parameter {
+class c_database_query_parameter_float extends c_base_return_float implements i_database_query_parameter {
/**
* @see: t_base_return_value::p_s_new()
* Assigns the array from a serialized array string.
*
* @param string $serialized
- * A serialized string to convert to an array.
+ * A serialized string to convert to an array.
*
* @return bool
* TRUE on success, FALSE otherwise.
}
/**
- * Returns the data as a json-serialized array string.
+ * Assigns the array from a json-serialized array string.
*
* @param string $jsonized
- * A jsonized string to convert to an array.
+ * A jsonized string to convert to an array.
* @param bool $associative
* (optional) When TRUE array is return as an associative array.
* @param int $options
return FALSE;
}
}
+
+/**
+ * A query parameter representing an embedded query.
+ *
+ * @see: c_base_return_object
+ * @see: i_database_query
+ */
+class c_database_query_parameter_query extends c_base_return_object implements i_database_query_parameter {
+
+ /**
+ * @see: t_base_return_value::p_s_new()
+ */
+ public static function s_new($value) {
+ return self::p_s_new($value, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value::p_s_value()
+ */
+ public static function s_value($return) {
+ return self::p_s_value($return, __CLASS__);
+ }
+
+ /**
+ * @see: t_base_return_value_exact::p_s_value_exact()
+ */
+ public static function s_value_exact($return) {
+ return self::p_s_value_exact($return, __CLASS__, '');
+ }
+
+ /**
+ * Assign the value.
+ *
+ * @param object $value
+ * Any value so long as it is an object.
+ * This object is cloned.
+ * NULL is not allowed.
+ *
+ * @return bool
+ * TRUE on success, FALSE otherwise.
+ *
+ * @see: clone()
+ */
+ public function set_value($value) {
+ $this->value = clone($value);
+ return parent::set_value($value);
+ }
+
+ /**
+ * Return the value.
+ *
+ * @return object|null $value
+ * The value object stored within this class.
+ * NULL may be returned if there is no defined valid resource.
+ */
+ public function get_value() {
+ if ($this->value instanceof i_database_query) {
+ return $this->value;
+ }
+
+ $this->value = NULL;
+ return NULL;
+ }
+
+ /**
+ * Return the value of the expected type.
+ *
+ * @return array $value
+ * The value array stored within this class.
+ */
+ public function get_value_exact() {
+ if ($this->value instanceof i_database_query) {
+ return $this->value;
+ }
+
+ $class = __CLASS__;
+ return new $class();
+ }
+}
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ROLLBACK query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
require_once('common/database/classes/database_query.php');
-require_once('common/database/traits/database_query.php');
/**
* The class for building and returning a Postgresql ALTER COALATION query string.
*/
public function do_reset();
}
-
-/**
- * An interface for passing arguments to a query that may or may not have SQL functions.
- */
-interface i_database_argument {
-
- /**
- * Build the Postgresql query argument.
- *
- * @return c_base_return_bool
- * TRUE is returned on success.
- * FALSE without error bit set is returned if there is nothing to build.
- * FALSE with the error bit set is returned on error.
- */
- public function do_build_argument();
-
- /**
- * Reset all argument values in this class.
- *
- * @return c_base_return_status
- * TRUE on success, FALSE otherwise.
- * FALSE with the error bit set is returned on error.
- */
- public function do_reset_argument();
-}
--- /dev/null
+<?php
+/**
+ * @file
+ * Provides interfaces for specific Postgesql Queries parameters.
+ *
+ * @see: https://www.postgresql.org/docs/current/static/sql-commands.html
+ */
+namespace n_koopa;
+
+/**
+ * An interface for passing query parameters to a query for use by PDO or similar.
+ *
+ * This is defined as a way to achieve multiple inheritance for the purposes of class type detection.
+ */
+interface i_database_query_parameter {
+
+ /**
+ * @see: c_base_return::s_new().
+ */
+ public static function s_new($value);
+
+ /**
+ * @see: t_base_return_value::s_value()
+ */
+ public static function s_value($return);
+
+ /**
+ * @see: t_base_return_value_exact::s_value_exact()
+ */
+ public static function s_value_exact($return);
+
+ /**
+ * @see: c_base_return::has_value()
+ */
+ public function set_value($value);
+
+ /**
+ * @see: c_base_return::get_value()
+ */
+ public function get_value();
+
+ /**
+ * @see: c_base_return::get_value_exact()
+ */
+ public function get_value_exact();
+
+ /**
+ * @see: c_base_return::has_value()
+ */
+ public function has_value();
+}
* A query only performs one action.
*/
trait t_database_action {
- protected $query_action;
+ protected $action;
/**
* Assigns this query action.
* TRUE on success, FALSE otherwise.
* FALSE with error bit set is returned on error.
*/
- public function set_query_action($action) {
+ public function set_action($action) {
if (is_null($action)) {
- $this->query_action = NULL;
+ $this->action = NULL;
return new c_base_return_true();
}
if (is_int($action)) {
- $this->query_action = $action;
+ $this->action = $action;
return new c_base_return_true();
}
* A single property that is associated with a particular action.
*/
trait t_database_action_property {
- protected $query_action_property;
+ protected $action_property;
/**
* Assigns this query action property.
*
- * @param int|null $property
+ * @param int|null $action_property
* Whether or not to use a action property associated.
* Set to NULL to disable.
*
* TRUE on success, FALSE otherwise.
* FALSE with error bit set is returned on error.
*/
- public function set_query_action_property($property) {
- if (is_null($property)) {
- $this->query_action_property = NULL;
+ public function set_action_property($action_property) {
+ if (is_null($action_property)) {
+ $this->action_property = NULL;
return new c_base_return_true();
}
- if (is_int($property)) {
- $this->query_action_property = $property;
+ if (is_int($action_property)) {
+ $this->action_property = $action_property;
return new c_base_return_true();
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'property', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'action_property', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
* NULL is returned if undefined.
* FALSE with error bit set is returned on error.
*/
- protected function get_query_action_property() {
- if (is_null($this->query_action_property)) {
+ protected function get_action_property() {
+ if (is_null($this->action_property)) {
return new c_base_return_null();
}
- return c_base_return_int::s_new($this->query_action_property);
+ return c_base_return_int::s_new($this->action_property);
}
}
* Provide the sql GROUP BY functionality.
*/
trait t_database_group_by {
- protected $query_group_by;
+ protected $group_by;
/**
* Set the GROUP BY settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_group_by($group_by) {
+ public function set_group_by($group_by) {
if (is_null($group_by)) {
- $this->query_group_by = NULL;
+ $this->group_by = NULL;
return new c_base_return_true();
}
if (is_string($group_by)) {
- $this->query_group_by = $group_by;
+ $this->group_by = $group_by;
return new c_base_return_true();
}
* NULL is returned if not set (group by is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_group_by() {
- if (is_null($this->query_group_by)) {
+ public function get_group_by() {
+ if (is_null($this->group_by)) {
return new c_base_return_null();
}
- if (is_string($this->query_group_by)) {
- return c_base_return_string::s_new($this->query_group_by);
+ if (is_string($this->group_by)) {
+ return c_base_return_string::s_new($this->group_by);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_group_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'group_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide the sql IN SCHEMA functionality.
*/
trait t_database_in_schema {
- protected $query_in_schema;
+ protected $in_schema;
/**
* Set the in schema, schema names.
* TRUE on success, FALSE otherwise.
* FALSE with error bit set is returned on error.
*/
- public function set_query_in_schema($schema_name, $append = TRUE) {
+ public function set_in_schema($schema_name, $append = TRUE) {
if (is_null($schema_name)) {
- $this->query_in_schema = NULL;
+ $this->in_schema = NULL;
return new c_base_return_true();
}
if (is_string($schema_name)) {
if ($append) {
- if (!is_array($this->query_in_schema)) {
- $this->query_in_schema = [];
+ if (!is_array($this->in_schema)) {
+ $this->in_schema = [];
}
- $this->query_in_schema[] = $schema_name;
+ $this->in_schema[] = $schema_name;
}
else {
- $this->query_in_schema = [$schema_name];
+ $this->in_schema = [$schema_name];
}
return new c_base_return_true();
* A single schema name is returned if $index is an integer.
* NULL with the error bit set is returned on error.
*/
- public function get_query_in_schema($index = NULL) {
- if (is_null($this->query_in_schema)) {
+ public function get_in_schema($index = NULL) {
+ if (is_null($this->in_schema)) {
return new c_base_return_null();
}
if (is_null($index)) {
- if (is_array($this->query_in_schema)) {
- return c_bse_return_array::s_new($this->query_in_schema);
+ if (is_array($this->in_schema)) {
+ return c_base_return_array::s_new($this->in_schema);
}
}
else {
- if (is_int($index) && array_key_exists($index, $this->query_in_schema) && is_string($this->query_in_schema[$index])) {
- return c_base_return_string::s_new($this->query_in_schema[$index]);
+ if (is_int($index) && array_key_exists($index, $this->in_schema) && is_string($this->in_schema[$index])) {
+ return c_base_return_string::s_new($this->in_schema[$index]);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_in_schema[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'in_schema[index]', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_in_schema', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'in_schema', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide the sql NAME functionality.
*/
trait t_database_name {
- protected $query_name;
+ protected $name;
/**
* Set the NAME settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_name($name) {
+ public function set_name($name) {
if (is_null($name)) {
- $this->query_name = NULL;
+ $this->name = NULL;
return new c_base_return_true();
}
if (is_string($name)) {
- $this->query_name = $name;
+ $this->name = $name;
return new c_base_return_true();
}
* NULL is returned if not set.
* NULL with the error bit set is returned on error.
*/
- public function get_query_name() {
- if (is_null($this->query_name)) {
+ public function get_name() {
+ if (is_null($this->name)) {
return new c_base_return_null();
}
- if (is_string($this->query_name)) {
- return c_base_return_string::s_new($this->query_name);
+ if (is_string($this->name)) {
+ return c_base_return_string::s_new($this->name);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide option support for an SQL query.
*/
trait t_database_option {
- protected $query_option;
+ protected $option;
/**
* Assigns this query option.
* TRUE on success, FALSE otherwise.
* FALSE with error bit set is returned on error.
*/
- public function set_query_option($option) {
+ public function set_option($option) {
if (is_null($grant)) {
- $this->query_option = NULL;
+ $this->option = NULL;
return new c_base_return_true();
}
if (is_int($option)) {
- $this->query_option = $option;
+ $this->option = $option;
return new c_base_return_true();
}
* FALSE with error bit set is returned on error.
*/
protected function get_option() {
- if (is_null($this->query_option)) {
+ if (is_null($this->option)) {
return new c_base_return_null();
}
- return c_base_return_int::s_new($this->query_option);
+ return c_base_return_int::s_new($this->option);
}
}
* Provide the sql ORDER BY functionality.
*/
trait t_database_order_by {
- protected $query_order_by;
+ protected $order_by;
/**
* Set the ORDER BY settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_order_by($order_by) {
+ public function set_order_by($order_by) {
if (is_null($order_by)) {
- $this->query_order_by = NULL;
+ $this->order_by = NULL;
return new c_base_return_true();
}
if (is_string($order_by)) {
- $this->query_order_by = $order_by;
+ $this->order_by = $order_by;
return new c_base_return_true();
}
* NULL is returned if not set (order by to is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_order_by() {
- if (is_null($this->query_order_by)) {
+ public function get_order_by() {
+ if (is_null($this->order_by)) {
return new c_base_return_null();
}
- if (is_string($this->query_order_by)) {
- return c_base_return_string::s_new($this->query_order_by);
+ if (is_string($this->order_by)) {
+ return c_base_return_string::s_new($this->order_by);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_order_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'order_by', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
require_once('common/base/classes/base_error.php');
require_once('common/base/classes/base_return.php');
-require_once('common/database/enumerations/database_owner_to.php');
require_once('common/database/enumerations/database_user.php');
require_once('common/database/classes/database_string.php');
* Provide sql OWNER TO functionality.
*/
trait t_database_owner_to {
- protected $query_owner_to;
- protected $query_owner_to_user_name;
+ protected $owner_to;
+ protected $owner_to_user_name;
/**
* Set the OWNER TO settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_owner_to($owner_to, $user_name = NULL) {
+ public function set_owner_to($owner_to, $user_name = NULL) {
if (is_null($owner_to)) {
- $this->query_owner_to = NULL;
- $this->query_owner_to_user_name = NULL;
+ $this->owner_to = NULL;
+ $this->owner_to_user_name = NULL;
return new c_base_return_true();
}
return c_base_return_error::s_false($error);
}
- $this->query_owner_to = $owner_to;
- $this->query_owner_to_user_name = $user_name;
+ $this->owner_to = $owner_to;
+ $this->owner_to_user_name = $user_name;
return new c_base_return_true();
}
return c_base_return_error::s_false($error);
}
- $this->query_owner_to = $owner_to;
- $this->query_owner_to_user_name = NULL;
+ $this->owner_to = $owner_to;
+ $this->owner_to_user_name = NULL;
if ($owner_type == e_database_user::CURRENT) {
- $this->query_owner_to_user_name = c_database_string::USER_CURRENT;
+ $this->owner_to_user_name = c_database_string::USER_CURRENT;
}
else if ($owner_type == e_database_user::SESSION) {
- $this->query_owner_to_user_name = c_database_string::USER_SESSION;
+ $this->owner_to_user_name = c_database_string::USER_SESSION;
}
return new c_base_return_true();
* NULL without error bit set is returned if not assigned.
* NULL with the error bit set is returned on error.
*/
- public function get_query_owner_to() {
- if (is_null($this->query_owner_to)) {
+ public function get_owner_to() {
+ if (is_null($this->owner_to)) {
return new c_base_return_null();
}
- if (is_int($this->query_owner_to)) {
- return c_base_return_int::s_new($this->query_owner_to);
+ if (is_int($this->owner_to)) {
+ return c_base_return_int::s_new($this->owner_to);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_owner_to', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'owner_to', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
* NULL without error bit set is returned if not assigned.
* NULL with the error bit set is returned on error.
*/
- public function get_query_owner_to_user_name() {
- if (is_null($this->query_owner_to_user_name)) {
+ public function get_owner_to_user_name() {
+ if (is_null($this->owner_to_user_name)) {
return new c_base_return_null();
}
- if (is_string($this->query_owner_to_user_name)) {
- return c_base_return_string::s_new($this->query_owner_to_user_name);
+ if (is_string($this->owner_to_user_name)) {
+ return c_base_return_string::s_new($this->owner_to_user_name);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_owner_to_user_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'owner_to_user_name', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide the sql RENAME TO functionality.
*/
trait t_database_rename_to {
- protected $query_rename_to;
+ protected $rename_to;
/**
* Set the RENAME TO settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_rename_to($rename_to) {
+ public function set_rename_to($rename_to) {
if (!is_null($rename_to) && !is_string($rename_to)) {
$error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'rename_to', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
- $this->query_rename_to = $rename_to;
+ $this->rename_to = $rename_to;
return new c_base_return_true();
}
* NULL is returned if not set (rename to is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_rename_to() {
- if (is_null($this->query_rename_to)) {
+ public function get_rename_to() {
+ if (is_null($this->rename_to)) {
return new c_base_return_null();
}
- if (is_string($this->query_rename_to)) {
- return c_base_return_string::s_new($this->query_rename_to);
+ if (is_string($this->rename_to)) {
+ return c_base_return_string::s_new($this->rename_to);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_rename_to', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'rename_to', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
require_once('common/database/enumerations/database_reset.php');
-require_once('common/database/classes/database_code.php');
-
/**
* Provide the sql RESET functionality.
*/
trait t_database_reset {
- protected $query_reset;
- protected $query_reset_parameter;
+ protected $reset;
+ protected $reset_parameter;
/**
* Set the RESET settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_reset($reset, $parameter = NULL) {
+ public function set_reset($reset, $parameter = NULL) {
if (is_null($reset)) {
- $this->query_reset = NULL;
- $this->query_reset_parameter = NULL;
+ $this->reset = NULL;
+ $this->reset_parameter = NULL;
return new c_base_return_true();
}
return c_base_return_error::s_false($error);
}
- $this->query_reset = $reset;
- $this->query_reset_parameter = $parameter;
+ $this->reset = $reset;
+ $this->reset_parameter = $parameter;
return new c_base_return_true();
}
else if ($reset == e_database_reset::ALL) {
- $this->query_reset = $reset;
- $this->query_reset_parameter = NULL;
+ $this->reset = $reset;
+ $this->reset_parameter = NULL;
return new c_base_return_true();
}
* NULL is returned if not set (reset tablespace is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_reset() {
- if (is_null($this->query_reset)) {
+ public function get_reset() {
+ if (is_null($this->reset)) {
return new c_base_return_null();
}
- if (is_int($this->query_reset)) {
- return c_base_return_int::s_new($this->query_reset);
+ if (is_int($this->reset)) {
+ return c_base_return_int::s_new($this->reset);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_reset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'reset', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
* NULL without error bit reset is returned if not assigned.
* NULL with the error bit reset is returned on error.
*/
- public function get_query_reset_parameter() {
- if (is_null($this->query_reset_parameter)) {
+ public function get_reset_parameter() {
+ if (is_null($this->reset_parameter)) {
return new c_base_return_null();
}
- if (is_string($this->query_reset_parameter)) {
- return c_base_return_string::s_new($this->query_reset_parameter);
+ if (is_string($this->reset_parameter)) {
+ return c_base_return_string::s_new($this->reset_parameter);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_reset_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'reset_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
require_once('common/database/enumerations/database_set.php');
-require_once('common/database/classes/database_code.php');
-
/**
* Provide the sql SET functionality.
*/
trait t_database_set {
- protected $query_set;
- protected $query_set_parameter;
- protected $query_set_value;
+ protected $set;
+ protected $set_parameter;
+ protected $set_value;
/**
* Set the SET settings.
*
* @param int|null $set
* The SET code to assign.
- * Should be one of: c_database_code_set.
+ * Should be one of: e_database_set.
* Set to NULL to disable.
* @param string|null $parameter
* (optional) When non-NULL this is the configuration parameter.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_set($set, $parameter = NULL, $value = NULL) {
+ public function set_set($set, $parameter = NULL, $value = NULL) {
if (is_null($set)) {
- $this->query_set = NULL;
- $this->query_set_parameter = NULL;
- $this->query_set_value = NULL;
+ $this->set = NULL;
+ $this->set_parameter = NULL;
+ $this->set_value = NULL;
return new c_base_return_true();
}
return c_base_return_error::s_false($error);
}
- $this->query_set = $set;
- $this->query_set_parameter = $parameter;
- $this->query_set_value = $value;
+ $this->set = $set;
+ $this->set_parameter = $parameter;
+ $this->set_value = $value;
return new c_base_return_true();
}
else if ($set == e_database_set::FROM_CURRENT) {
- $this->query_set = $set;
- $this->query_set_parameter = NULL;
- $this->query_set_value = NULL;
+ $this->set = $set;
+ $this->set_parameter = NULL;
+ $this->set_value = NULL;
return new c_base_return_true();
}
* NULL is returned if not set (set tablespace is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_set() {
- if (is_null($this->query_set)) {
+ public function get_set() {
+ if (is_null($this->set)) {
return new c_base_return_null();
}
- if (is_int($this->query_set)) {
- return c_base_return_int::s_new($this->query_set);
+ if (is_int($this->set)) {
+ return c_base_return_int::s_new($this->set);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_set', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
* NULL without error bit set is returned if not assigned.
* NULL with the error bit set is returned on error.
*/
- public function get_query_set_parameter() {
- if (is_null($this->query_set_parameter)) {
+ public function get_set_parameter() {
+ if (is_null($this->set_parameter)) {
return new c_base_return_null();
}
- if (is_string($this->query_set_parameter)) {
- return c_base_return_string::s_new($this->query_set_parameter);
+ if (is_string($this->set_parameter)) {
+ return c_base_return_string::s_new($this->set_parameter);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_set_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_parameter', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
* NULL without error bit set is returned if not assigned.
* NULL with the error bit set is returned on error.
*/
- public function get_query_set_value() {
- if (is_null($this->query_set_value)) {
+ public function get_set_value() {
+ if (is_null($this->set_value)) {
return new c_base_return_null();
}
- if (is_string($this->query_set_value)) {
- return c_base_return_string::s_new($this->query_set_value);
+ if (is_string($this->set_value)) {
+ return c_base_return_string::s_new($this->set_value);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_set_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_value', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide the sql SET SCHEMA functionality.
*/
trait t_database_set_schema {
- protected $query_set_schema;
+ protected $set_schema;
/**
* Set the RENAME TO settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_set_schema($set_schema) {
+ public function set_set_schema($set_schema) {
if (!is_null($set_schema) && !is_string($set_schema)) {
$error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'set_schema', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
- $this->query_set_schema = $set_schema;
+ $this->set_schema = $set_schema;
return new c_base_return_true();
}
* NULL is returned if not set (set schema is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_set_schema() {
- if (is_null($this->query_set_schema)) {
+ public function get_set_schema() {
+ if (is_null($this->set_schema)) {
return new c_base_return_null();
}
- if (is_string($this->query_set_schema)) {
- return c_base_return_string::s_new($this->query_set_schema);
+ if (is_string($this->set_schema)) {
+ return c_base_return_string::s_new($this->set_schema);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_set_schema', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_schema', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}
* Provide the sql SET TABLESPACE functionality.
*/
trait t_database_set_tablespace {
- protected $query_set_tablespace;
+ protected $set_tablespace;
/**
* Set the SET TABLESPACE settings.
* TRUE on success, FALSE otherwise.
* FALSE with the error bit set is returned on error.
*/
- public function set_query_set_tablespace($set_tablespace) {
+ public function set_set_tablespace($set_tablespace) {
if (!is_null($set_tablespace) && !is_string($set_tablespace)) {
$error = c_base_error::s_log(NULL, ['arguments' => [':{argument_name}' => 'set_tablespace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_ARGUMENT);
return c_base_return_error::s_false($error);
}
- $this->query_set_tablespace = $set_tablespace;
+ $this->set_tablespace = $set_tablespace;
return new c_base_return_true();
}
* NULL is returned if not set (set tablespace is not to be used).
* NULL with the error bit set is returned on error.
*/
- public function get_query_set_tablespace() {
- if (is_null($this->query_set_tablespace)) {
+ public function get_set_tablespace() {
+ if (is_null($this->set_tablespace)) {
return new c_base_return_null();
}
- if (is_string($this->query_set_tablespace)) {
- return c_base_return_string::s_new($this->query_set_tablespace);
+ if (is_string($this->set_tablespace)) {
+ return c_base_return_string::s_new($this->set_tablespace);
}
- $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'query_set_tablespace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
+ $error = c_base_error::s_log(NULL, ['arguments' => [':{variable_name}' => 'set_tablespace', ':{function_name}' => __CLASS__ . '->' . __FUNCTION__]], i_base_error_messages::INVALID_VARIABLE);
return c_base_return_error::s_null($error);
}
}