Permalink
Browse files

Mostly style changes

  • Loading branch information...
Alexander Pánek
Alexander Pánek committed Mar 25, 2013
1 parent c1a3d44 commit 74c3da2805f7df4ad16a12f081837ccd310f8f57
Showing with 7 additions and 7 deletions.
  1. +6 −6 lib/Bacon/ORM/Collection.php
  2. +1 −1 lib/Bacon/ORM/Model.php
@@ -155,8 +155,8 @@ public function is_empty ()
public function select($args)
{
if (!is_array($args)) {
$args = [$args];
if (!is_an_array($args)) {
$args = [ $args ];
}
$this->select_list = $args;
@@ -171,7 +171,7 @@ public function where($args = [])
}
if (is_string($args)) {
$args = [$args];
$args = [ $args ];
}
$this->where_scope = array_merge($this->where_scope, $args);
@@ -283,15 +283,15 @@ private function load()
$statement .= ' FROM ' . $this->table_name;
$wc = $this->where_conditions();
$statement .= $wc['statement'];
$values = array_merge($values, $wc['values']);
$statement .= $wc->statement;
$values = array_merge($values, $wc->values);
if (!empty($this->group_scope)) {
$statement .= ' GROUP BY ' . $this->group_scope;
}
if (!empty($this->order_scope)) {
$order_scope = array_merge(['by' => 'id', 'direction' => 'ASC'], $this->order_scope);
$order_scope = array_merge([ 'by' => 'id', 'direction' => 'ASC' ], $this->order_scope);
$statement .= ' ORDER BY ' . $order_scope['by'] . ' ' . $order_scope['direction'];
}
@@ -136,7 +136,7 @@ public function delete ()
public static function find($id)
{
return Collection::_where(get_called_class(), [static::$primary_key => $id])->first();
return Collection::_where(get_called_class(), [ static::$primary_key => $id ])->first();
}
public static function all()

0 comments on commit 74c3da2

Please sign in to comment.