Skip to content

Commit

Permalink
Database::orwhere() is now Database_Builder::or_where()
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Nov 27, 2009
1 parent 3dd8bf2 commit dee3ee8
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion modules/exif/helpers/exif.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static function stats() {
->where("type", "=", "photo")
->and_open()
->where("exif_records.item_id", "=", null)
->orwhere("exif_records.dirty", "=", 1)
->or_where("exif_records.dirty", "=", 1)
->close()
->get()
->count();
Expand Down
2 changes: 1 addition & 1 deletion modules/exif/helpers/exif_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static function update_index($task) {
->where("type", "=", "photo")
->and_open()
->where("exif_records.item_id", "=", null)
->orwhere("exif_records.dirty", "=", 1)
->or_where("exif_records.dirty", "=", 1)
->close()
->find_all() as $item) {
// The query above can take a long time, so start the timer after its done
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/controllers/albums.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function update($album_id) {
->where("id", "<>", $album->id)
->and_open()
->where("name", "=", $form->edit_item->dirname->value)
->orwhere("slug", "=", $form->edit_item->slug->value)
->or_where("slug", "=", $form->edit_item->slug->value)
->close()
->get()
->current()) {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/controllers/movies.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function update($movie_id) {
->where("id <>", $movie->id)
->and_open()
->where("name", "=", $form->edit_item->filename->value)
->orwhere("slug", "=", $form->edit_item->slug->value)
->or_where("slug", "=", $form->edit_item->slug->value)
->close()
->get()
->current()) {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/controllers/photos.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function update($photo_id) {
->where("id", "<>", $photo->id)
->and_open()
->where("name", "=", $form->edit_item->filename->value)
->orwhere("slug", "=", $form->edit_item->slug->value)
->or_where("slug", "=", $form->edit_item->slug->value)
->close()
->get()
->current()) {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/helpers/album.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static function create($parent, $name, $title, $description=null, $owner_id=null
->where("parent_id", "=", $parent->id)
->and_open()
->where("name", "=", $album->name)
->orwhere("slug", "=", $album->slug)
->or_where("slug", "=", $album->slug)
->close()
->find()->id) {
$rand = rand();
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/helpers/movie.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static function create($parent, $filename, $name, $title,
->where("parent_id", "=", $parent->id)
->and_open()
->where("name", "=", $movie->name)
->orwhere("slug", "=", $movie->slug)
->or_where("slug", "=", $movie->slug)
->close()
->find()->id) {
$rand = rand();
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/helpers/photo.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static function create($parent, $filename, $name, $title,
->where("parent_id", "=", $parent->id)
->and_open()
->where("name", "=", $photo->name)
->orwhere("slug", "=", $photo->slug)
->or_where("slug", "=", $photo->slug)
->close()
->find()->id) {
$rand = rand();
Expand Down
8 changes: 4 additions & 4 deletions modules/gallery/tests/Database_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function compound_where_test() {
->where("outer1", "=", 1)
->and_open()
->where("inner1", "=", 1)
->orwhere("inner2", "=", 2)
->or_where("inner2", "=", 2)
->close()
->where("outer2", "=", 2)
->compile();
Expand All @@ -46,7 +46,7 @@ function group_first_test() {
$sql = Database::instance()
->and_open()
->where("inner1", "=", 1)
->orwhere("inner2", "=", 2)
->or_where("inner2", "=", 2)
->close()
->where("outer1", "=", 1)
->where("outer2", "=", 2)
Expand All @@ -62,8 +62,8 @@ function where_array_test() {
->where("outer1", "=", 1)
->and_open()
->where("inner1", "=", 1)
->orwhere("inner2", "=", 2)
->orwhere("inner3", "=", 3))
->or_where("inner2", "=", 2)
->or_where("inner3", "=", 3))
->close()
->compile();
$sql = str_replace("\n", " ", $sql);
Expand Down
2 changes: 1 addition & 1 deletion modules/search/helpers/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static function stats() {
->join("search_records", "items.id", "search_records.item_id", "left")
->and_open()
->where("search_records.item_id", "=", null)
->orwhere("search_records.dirty", "=", 1)
->or_where("search_records.dirty", "=", 1)
->close()
->get()
->count();
Expand Down
2 changes: 1 addition & 1 deletion modules/search/helpers/search_task.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static function update_index($task) {
foreach (ORM::factory("item")
->join("search_records", "items.id", "search_records.item_id", "left")
->where("search_records.item_id", "=", null)
->orwhere("search_records.dirty", "=", 1)
->or_where("search_records.dirty", "=", 1)
->find_all() as $item) {
// The query above can take a long time, so start the timer after its done
// to give ourselves a little time to actually process rows.
Expand Down

0 comments on commit dee3ee8

Please sign in to comment.