original_string: protected function _checkNode($path, $alias, $parentId = null)
      {
          $node = $this->Aco->node($path);
          if (!$node) {
              $data = [
                  'parent_id' => $parentId,
                  'model' => null,
                  'alias' => $alias,
              ];
              $entity = $this->Aco->newEntity($data);
              $node = $this->Aco->save($entity);
              $this->counter++;
              // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path));
          } else {
              $node = $node->first();
          }
  
          return $node;
      }
code: protected function _checkNode($path, $alias, $parentId = null)
      {
          $node = $this->Aco->node($path);
          if (!$node) {
              $data = [
                  'parent_id' => $parentId,
                  'model' => null,
                  'alias' => $alias,
              ];
              $entity = $this->Aco->newEntity($data);
              $node = $this->Aco->save($entity);
              $this->counter++;
              // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path));
          } else {
              $node = $node->first();
          }
  
          return $node;
      }
code_tokens: protected function _checkNode ( $ path , $ alias , $ parentId = null ) { $ node = $ this -> Aco -> node ( $ path ) ; if ( ! $ node ) { $ data = [ 'parent_id' => $ parentId , 'model' => null , 'alias' => $ alias , ] ; $ entity = $ this -> Aco -> newEntity ( $ data ) ; $ node = $ this -> Aco -> save ( $ entity ) ; $ this -> counter ++ ; // $this->out(__d('cake_acl', 'Created Aco node: {0}', $path)); } else { $ node = $ node -> first ( ) ; } return $ node ; }
docstring: Check a node for existance, create it if it doesn't exist.
  
  @param string $path The path to check
  @param string $alias The alias to create
  @param int $parentId The parent id to use when creating.
  @return array Aco Node array
docstring_tokens: Check a node for existance create it if it doesn t exist .