Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Changing the use of an anonymous function to php 5.2.8 compatible code
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed May 4, 2014
1 parent 5b60c85 commit 715bbac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Model/Behavior/TaggableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,13 @@ public function saveTags(Model $model, $string = null, $foreignKey = null, $upda
extract($this->disassembleTags($model, $string, $this->settings[$model->alias]['separator']));

if (!empty($tags)) {
$conditions = array('OR' => array_map(function ($tag) use ($tagModel) {
return array(
$conditions = array();
foreach ($tags as $tag) {
$conditions['OR'][] = array(
$tagModel->alias . '.identifier' => $tag['identifier'],
$tagModel->alias . '.keyname' => $tag['keyname'],
);
}, $tags));
}
$existingTags = $tagModel->find('all', array(
'contain' => array(),
'conditions' => $conditions,
Expand Down

0 comments on commit 715bbac

Please sign in to comment.