Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Basic ORM module
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/samsonos/php_activerecord/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/samsonos/php_activerecord/?branch=master)
[![Total Downloads](https://poser.pugx.org/samsonos/php_activerecord/downloads.svg)](https://packagist.org/packages/samsonos/php_activerecord)

Developed by [SamsonOS](http://samsonos.com/)
Developed by [SamsonOS](http://samsonos.com/)
13 changes: 6 additions & 7 deletions src/dbMySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ protected function protectQueryValue($value)
}

/** @deprecated Use execute() */
public function &simple_query($sql)
public function simple_query($sql)
{
return $this->query($sql);
}
Expand Down Expand Up @@ -264,11 +264,10 @@ protected function &getQueryFields($className, & $object = null, $straight = fal
}

// Only add attributes that have value
if ($object->$map_attribute != null) {
$value = $this->driver->quote($object->$map_attribute);
// Добавим значение поля, в зависимости от вида вывывода метода
$collection[$map_attribute] = ($straight ? $className::$_table_name . '.' . $map_attribute . '=' : '') . $value;
}
$value = $object->$map_attribute !== null ? $this->driver->quote($object->$map_attribute) : 'NULL';

// Добавим значение поля, в зависимости от вида вывывода метода
$collection[$map_attribute] = ($straight ? $className::$_table_name . '.' . $map_attribute . '=' : '') . $value;
}

// Вернем полученную коллекцию
Expand Down Expand Up @@ -579,7 +578,7 @@ public function &createObject(
if (!isset(dbRecord::$instances[$className][$identifier]) || isset($dbData['__Count']) || sizeof($virtualFields)) {

// Create empry dbRecord ancestor and store it to cache
dbRecord::$instances[$className][$identifier] = new $className();
dbRecord::$instances[$className][$identifier] = new $className($this, new dbQuery());

// Pointer to object
$object = &dbRecord::$instances[$className][$identifier];
Expand Down
3 changes: 2 additions & 1 deletion src/dbQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ public function __construct($entity = 'material')
$entity = '\samson\activerecord\\'.$entity;
}

$this->order = &$this->sorting;
$this->order = &$this->sorting;
$this->group = &$this->grouping;

// Call parent constructor
parent::__construct(db());
Expand Down