Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. public function classify(array $data)
  2. {
  3.     if (isset($data[$this->attribute])) {
  4.         $attrValue = $data[$this->attribute];
  5.         if (!$this->hasValue($attrValue)) {
  6.             return 'unclassified';
  7.         }
  8.         $child = $this->values[$attrValue];
  9.         if (!$child->getIsLeaf()) {
  10.             return $child->classify($data);
  11.         } else {
  12.             return $child->getChild('result');
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement