original_string: private function __findAro($aro) {
          
          
          if(isset($aro->parent_id)) {
              $conditions = [
                  'parent_id' => $aro->parent_id,
                  'foreign_key' => $aro->foreign_key,
                  'model' => $aro->model
              ];
          } else {
              $conditions = [
                  'parent_id IS NULL',
                  'foreign_key' => $aro->foreign_key,
                  'model' => $aro->model
              ];
          }
  
          return $this->Acl->Aro->find('all', [
              'conditions' => $conditions,
              'recursive' => -1
          ])->count();
      }
code: private function __findAro($aro) {
          
          
          if(isset($aro->parent_id)) {
              $conditions = [
                  'parent_id' => $aro->parent_id,
                  'foreign_key' => $aro->foreign_key,
                  'model' => $aro->model
              ];
          } else {
              $conditions = [
                  'parent_id IS NULL',
                  'foreign_key' => $aro->foreign_key,
                  'model' => $aro->model
              ];
          }
  
          return $this->Acl->Aro->find('all', [
              'conditions' => $conditions,
              'recursive' => -1
          ])->count();
      }
code_tokens: private function __findAro ( $ aro ) { if ( isset ( $ aro -> parent_id ) ) { $ conditions = [ 'parent_id' => $ aro -> parent_id , 'foreign_key' => $ aro -> foreign_key , 'model' => $ aro -> model ] ; } else { $ conditions = [ 'parent_id IS NULL' , 'foreign_key' => $ aro -> foreign_key , 'model' => $ aro -> model ] ; } return $ this -> Acl -> Aro -> find ( 'all' , [ 'conditions' => $ conditions , 'recursive' => - 1 ] ) -> count ( ) ; }
docstring: Find aro in database and returns the number of matches
  
  @param object $aro
docstring_tokens: Find aro in database and returns the number of matches