public function depend($entity, $type) {
		$depend = $type === 'count' ? 0 : [];

		foreach (static::_dependent() as $model) {
			$results = $model::find($type, [
				'conditions' => [
					'tags' => $entity->name
				]
			]);
			if (!$results) {
				continue;
			}
			if ($type === 'count') {
				$depend += $results;
			} else {
				foreach ($results as $result) {
					$depend[] = $result;
				}
			}
		}
		return $depend;
	}
public function depend($entity, $type) {
		$depend = $type === 'count' ? 0 : [];

		foreach (static::_dependent() as $model) {
			$results = $model::find($type, [
				'conditions' => [
					'tags' => $entity->name
				]
			]);
			if (!$results) {
				continue;
			}
			if ($type === 'count') {
				$depend += $results;
			} else {
				foreach ($results as $result) {
					$depend[] = $result;
				}
			}
		}
		return $depend;
	}
public function depend ( $ entity , $ type ) { $ depend = $ type === 'count' ? 0 : [ ] ; foreach ( static :: _dependent ( ) as $ model ) { $ results = $ model :: find ( $ type , [ 'conditions' => [ 'tags' => $ entity -> name ] ] ) ; if ( ! $ results ) { continue ; } if ( $ type === 'count' ) { $ depend += $ results ; } else { foreach ( $ results as $ result ) { $ depend [ ] = $ result ; } } } return $ depend ; }
Do not use in performance criticial parts.
Do not use in performance criticial parts .