Skip to content

Commit

Permalink
hastag now allows for normal taxonomy
Browse files Browse the repository at this point in the history
  • Loading branch information
KellyLSB committed Mar 12, 2012
1 parent 28a30b8 commit 5717ae4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions extend/sql/library/extensions/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ public function modelHasTag(Model $model, $map = false) {
if(!$map) throw new Exception("No model Map was passed");
$tagTable = "\$tags ".$model->__getTable();

if($map instanceof Model);
else $map = e::map($map);
try {
if($map instanceof Model);
else $map = e::map($map);
}

catch(MapException $e) {
$map = e::$taxonomy->getTag($map);
}

$q = e::$sql->query("SELECT * FROM `$tagTable` WHERE `owner` = '$model->id' AND `model` = '".$map->__map('bundlename')."' AND `model-id` = '$map->id'")->row();

Expand Down

0 comments on commit 5717ae4

Please sign in to comment.