$this->setfields["$field"] = $field;
- if ($dovalidate AND method_exists($this, "validate_$field"))
+ if ($dovalidate && method_exists($this, "validate_$field"))
{
$this->{"validate_$field"}($field);
}
*/
public function setCondition($condition = null)
{
- if (is_array($condition) AND sizeof($condition) > 0)
+ if (is_array($condition) && sizeof($condition) > 0)
{
$this->condition = '';
- foreach ($condition AS $field)
+ foreach ($condition as $field)
{
if (!$this->values["$field"])
{
}
else
{
- foreach ($this->fields AS $name => $options)
+ foreach ($this->fields as $name => $options)
{
if ($options[F_REQ] == REQ_AUTO)
{
$this->_runActionMethod('pre_insert', $doPre);
$fields = $values = array();
- foreach ($this->setfields AS $field)
+ foreach ($this->setfields as $field)
{
$fields[] = $field;
$values[] = $this->_prepareFieldForSql($field);
if (BSApp::$db instanceof BSDbPostgreSql)
{
- foreach ($this->fields AS $field => $info)
+ foreach ($this->fields as $field => $info)
{
if ($info[F_REQ] == REQ_AUTO)
{
$this->_runActionMethod('pre_update', $doPre);
- foreach ($this->setfields AS $field)
+ foreach ($this->setfields as $field)
{
$updates[] = "$field = " . $this->_prepareFieldForSql($field);
}
*/
private function _verifyRequired()
{
- foreach ($this->fields AS $name => $options)
+ foreach ($this->fields as $name => $options)
{
if ($options[F_REQ] == REQ_YES)
{
*/
private function _runActionMethod($method, $doRun)
{
- if (!$doRun OR !method_exists($this, $method))
+ if (!$doRun || !method_exists($this, $method))
{
return;
}
{
$type = $this->fields["$name"][F_TYPE];
- if ($type == TYPE_NONE OR $type == TYPE_STR OR $type == TYPE_STRUN)
+ if ($type == TYPE_NONE || $type == TYPE_STR || $type == TYPE_STRUN)
{
return "'" . BSApp::$db->escapeString($this->values["$name"]) . "'";
}