Run the Validator

This function does all the work.

@param   string  $group
@return  bool
337083
public function run($group = '')
    {
        if (!empty($this->validation_data) || $this->CI->input->method() === 'post') {
            $this->ran = true;
            return parent::run($group);
        }
        return false;
    }
91787
public function validate($group, Constraint $constraint)
    {
        $check = $this->container->get('admin.configuration.configgroup_manager')->getRepository()->findOneBySectionAndGroupName($group->getConfigSection()->getName(), $group->getName());
        if ( $check && $check->getId() != $group->getId()) {
            $message = $this->container->get('translator')->trans(
                $constraint->message,
                array(
                    '%group%' => $group->getName(),
                    '%section%' => $group->getConfigSection()->getName()
                ),
                'VinceTAdminConfigurationBundle'
            );
            $this->context->addViolation($message);
        }
    }
766855
public function clean($group = null)
	{
		$prefix = $this->options['hash'] . '-cache-' . $group . '-';

		foreach ($this->data as $key => $value)
		{
			if (substr($key, 0, strlen($prefix)) == $prefix)
			{
				unset($this->data[$key]);
			}
		}

		return true;
	}
628456
function CheckGroupExists(
      $group = ''
  ) {
      $check_group = ('' != $group)?$group:$this->GetGroup();
      $result = FALSE;

      if ('' != trim($check_group)) {
          if ((($this->GetBackendTypeValidated()) && ('' != $this->_config_data['sql_groups_table'])) || ('files' == $this->GetBackendType())) {
              switch ($this->GetBackendType()) {
                  case 'mysql':
                      if ($this->OpenMysqlDatabase()) {
                          $sQuery  = "SELECT * FROM `".$this->_config_data['sql_groups_table']."` WHERE `group_id` = '{$check_group}'";
                          
                          if (is_object($this->_mysqli)) {
                              if (!($rResult = $this->_mysqli->query($sQuery))) {
                                  $this->WriteLog("Error: Unable to access the database: ".trim($this->_mysqli->error), FALSE, FALSE, 41, 'System', '', 3);
                              } else {
                                  $num_rows = $rResult->num_rows;
                              }
                          } elseif (!($rResult = mysql_query($sQuery, $this->_mysql_database_link))) {
                              $this->WriteLog("Error: Unable to access the database: ".mysql_error(), FALSE, FALSE, 41, 'System', '', 3);
                          } else {
                              $num_rows = mysql_num_rows($this->_mysql_database_link);
                          }
                          
                          if (0 == $num_rows) {
                              $this->WriteLog("Error: Group ".$group.". does not exist", FALSE, FALSE, 39, 'System', '', 3);
                              $result = FALSE;
                          } else {
                              $result = TRUE;
                          }
                      }
                      break;
                  case 'pgsql':
                      if ($this->OpenPGSQLDatabase()) {
                          $sQuery  = "SELECT * FROM \"".$this->_config_data['sql_schema']."\".\"".$this->_config_data['sql_groups_table']."\" WHERE \"group_id\" = '{$check_group}'";
                          
                          if (!($rResult = pg_query($this->_pgsql_database_link, $sQuery))) {
                              $this->WriteLog("Error: Unable to access the database: ".pg_last_error(), FALSE, FALSE, 41, 'System', '', 3);
                          } else {
                              $num_rows = pg_num_rows($rResult);
                          }
                          
                          if (0 == $num_rows) {
                              $this->WriteLog("Error: Group ".$group.". does not exist", FALSE, FALSE, 39, 'System', '', 3);
                              $result = FALSE;
                          } else {
                              $result = TRUE;
                          }
                      }
                      break;
                  case 'files':
                  default:
                      $group_filename = $this->EncodeFileId($check_group, FALSE).'.db';
                      if (!file_exists($this->GetGroupsFolder().$group_filename)) {
                          $group_filename = $this->EncodeFileId($check_group, FALSE, TRUE).'.db';
                      }
                      $result = file_exists($this->GetGroupsFolder().$group_filename);
                      break;
              }
          }
      }
      return $result;
  }
467046
public function removeGroup($group)
    {
        if (is_string($group)) {
            // If the group is a string, we'll assume the dev is passing
            // in a DN string of the group. We'll try to locate it.
            $group = $this->query->newInstance()->findByDn($group);
        }

        if ($group instanceof Group) {
            // If the group is Group model instance, we can
            // remove the current models DN from the group.
            return $group->removeMember($this->getDn());
        }

        return false;
    }
267006
public function hasGroup(GroupInterface $group): bool
    {
        foreach ($this->groups as $my_group) {
            if ($group->isEqualTo($my_group)) {
                return true;
            }
        }

        return false;
    }
1066407
public static function validate($instance, $group = "") {
		$class = get_class ( $instance );
		$cache = self::getClassCacheValidators ( $class, $group );
		if ($cache !== false) {
			return self::validateFromCache_ ( $instance, $cache );
		}
		$members = self::fetch ( $class );
		if ($group !== "") {
			$members = self::getGroupArrayValidators ( $members, $group );
		}
		return self::validate_ ( $instance, $members );
	}
763412
public function updateGroup(array $group)
    {
        $result = $this->httpRaw(self::WECHAT_GROUP_UPDATE_PREFIX, [
            'group' => $group
        ], [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
293703
final public function validate($data)
    {
        if ($this->_walk && (is_array($data) || is_object($data))) {
            $arr = (array)$data;

            foreach ($arr as $value) {
                if ($this->validate($value) ===  false) {
                    return false;
                }
            }
        } else {
            $context = $this->_chain->getContext();
            $context->data = $data;

            $result = $this->_chain->run('validate', $context);

            if ($result ===  false) {
                return false;
            }
        }

        return true;
    }
135519
public function insertGroup(Group $group)
    {
        $group->setGuid($this->container->get('claroline.utilities.misc')->generateGuid());
        $this->om->persist($group);
        $this->eventDispatcher->dispatch('log', 'Log\LogGroupCreate', array($group));
        $this->om->flush();
    }
351478
public function clean($group = null)
	{
		$success = true;

		if (is_dir($this->directory . DS . $group))
		{
			$this->engine->setOption('cacheDir', $this->directory . DS . $group . DS);
			$success = $this->engine->clean($group, 'group');
		}

		if ($success == true)
		{
			return $success;
		}

		return false;
	}
430163
function start($id, $group = 'default', $doNotTestCacheValidity = false)
    {
        $data = $this->get($id, $group, $doNotTestCacheValidity);
        if ($data !== false) {
            echo($data);
            return true;
        }
        ob_start();
        ob_implicit_flush(false);
        return false;
    }
966472
public function clean($group = null)
	{
		$keys = eaccelerator_list_keys();

		if (is_array($keys))
		{
			$hash = $this->options['hash'];

			foreach ($keys as $key)
			{
				// Trim leading ":" to work around list_keys namespace bug in eAcc.
				// This will still work when bug is fixed.
				$key['name'] = ltrim($key['name'], ':');

				if (strpos($key['name'], $hash . '-cache-' . $group . '-') === 0) // xor $mode != 'group')
				{
					eaccelerator_rm($key['name']);
				}
			}
		}

		return true;
	}
49356
protected function validateEditCategoryGroup()
    {
        $this->setSubmitted('category_group');
        $this->setSubmitted('update', $this->data_category_group);

        $this->validateComponent('category_group');

        return !$this->hasErrors(false);
    }
296627
public function delGroup($group) {
    if ($group->inArray((array) $this->groups)) {
      foreach ((array) $this->groups as $key => $curGroup) {
        if ($group->is($curGroup)) {
          unset($this->groups[$key]);
        }
      }
      return $this->groups;
    }
    return true;
  }
186082
public function deleteGroup(Group $group)
    {
        $this->eventDispatcher->dispatch(
            'claroline_groups_delete',
            'GenericData',
            [[$group]]
        );

        $this->om->remove($group);
        $this->om->flush();
    }
769584
public function clearGroup($group)
    {
        $success = false;
        apcu_inc($this->_config['prefix'] . $group, 1, $success);

        return $success;
    }