Return the amount of times the hook has been executed
@param string $hook The hook name
@return int The hook execution counter for this hook
7078
public static function getExecuteCount(string $hook)
    {
        return isset(self::$counters[$hook]) ? self::$counters[$hook] : 0;
    }
770136
public function doAction($hook)
    {
        $hook = (string) $hook;
        if (empty($this->hooks[$hook])) {
            return; // No hooks.
        }
        $hook_actions = $this->hooks[$hook];
        $args         = func_get_args();
        ksort($hook_actions);

        foreach ($hook_actions as $_hook_action) {
            foreach ($_hook_action as $_action) {
                if (!isset($_action['function'], $_action['accepted_args'])) {
                    continue; // Not a valid filter in this case.
                }
                call_user_func_array($_action['function'], array_slice($args, 1, $_action['accepted_args']));
            }
        }
        unset($_hook_action, $_action); // Housekeeping.
    }
43566
public function lastUpdatedDate() {
    $directory = $this->environment->getHooksDirectory();
    $hooks_file = "$directory/hooks_processed.php";
    if (file_exists($hooks_file)) {
      $timestamp = filemtime($hooks_file);
      return $timestamp;
    }
  }
129729
public function count()
    {
        $query = clone $this;
        $query->select = 'count(*)';
        return (int)$query->execute()->fetch(PDO::FETCH_NUM)[0];
    }
1180562
public function count($key)
    {
        if ($this->has($key)) {
            if (\is_array($this->get($key))) {
                return \count($this->get($key));
            }

            return 1;
        }

        return 0;
    }
375987
public function countResults(string $table): int
    {
        $queryBuilder = $this->conn->createQueryBuilder();
        $rows = $queryBuilder->select('COUNT(1)')->from($table)->execute();

        return (int) $rows->fetch(\Doctrine\DBAL\FetchMode::NUMERIC)[0];
    }
771952
public function countAffected($cursor = null)
    {
        if (!$cursor instanceof \PDOStatement) {
            $cursor = $this->getCursor();
        }

        if (!$cursor) {
            return 0;
        }

        return $cursor->rowCount();
    }
720479
public function count() {
		$cursor = $this->_adapter->find($this, null, null, true);
		
		return $cursor->count();
	}
629091
public function count(): int
    {
        $args = [];
        $methodName = __FUNCTION__;

        return (int) $this->findAndCall($methodName, $args);
    }
437526
public static function hasAction($hook = '', callable $callback = null, $priority = null)
    {
        return static::hasHook('action', $hook, $callback, $priority);
    }
701172
protected function calculateActionCount()
    {
        $counter = 0;
        foreach ($this->actions as $actions) {
            $counter += count($actions);
        }

        return $counter;
    }
1355534
public function Count($Operation) {
      $this->Permission('Garden.Moderation.Manage');

      if ($Operation == 'edits')
         $Operation = array('edit', 'delete');
      else
         $Operation = explode(',', $Operation);
      array_map('ucfirst', $Operation);

      $Count = $this->LogModel->GetCountWhere(array('Operation' => $Operation));

      if ($Count > 0)
         echo '<span class="Alert">', $Count, '</span>';
   }
340636
public function count(string $needle) : int
    {
        return substr_count(strtolower($this->getText()), strtolower($needle));
    }
1076803
public function with($hook)
    {
        if (!in_array($hook, PluginInterface::VALID_HOOKS)) {
            throw new InvalidArgumentException("The `{$hook}` hook is not a known plugin hook.");
        }
        foreach ($this as $plugin) {
            if ($plugin->isEnabled($hook)) {
                yield $plugin;
            }
        }
    }
339877
public function getCount( $pattern = NULL )
	{
		$count	= 0;
		$list	= $this->getList( $pattern );
		foreach( $list as $entry )
			$count++;
		return $count;
	}
484320
public function countAll(string $table): int
	{
		$sql = 'SELECT * FROM '.$this->driver->quoteTable($table);
		$res = $this->driver->query($sql);
		return (int) count($res->fetchAll());
	}
437756
public function getCount()
    {
        if ($this->_count !== null) {
            return $this->_count;
        }

        while ($this->_hasMore) {
            $this->fetchOutstanding();
        }

        return $this->_length;
    }