Checks the event and system validity then returns the content target, FALSE otherwise.

@param \BackBee\Event\Event $event
@param bool                 $check_status

@return bool
344026
private function checkCacheContentEvent($check_status = true)
    {
        // Checks if a service cache-control exists
        if (null === $this->cache_content) {
            return false;
        }

        // Checks if the target event is not a main contentset
        if (
            $this->object instanceof ContentSet
            && true === is_array($this->object->getPages())
            && 0 < $this->object->getPages()->count()
        ) {
            return false;
        }

        return true === $check_status ? $this->validator->isValid('cache_status', $this->object) : true;
    }
460321
public function checkbox($name = null, $value = null, $status = false, $attr = null)
    {
        $input = $this->createInput('checkbox', $name, $value, $attr);

        if($status)
            $input->attr('checked', true);

        return $input;
    }
16339
public function setStatus($name = '', $status = self::START) {
        if ($name != '') {
            if (isset($this->_events[$name])) {
                $this->_events[$name]->setStatus($status);

                return true;
            }
            else {
                return false;
            }
        }
        else {
            return false;
        }
    }
1321322
function checkState() {
                try {
                    var state = getDoc(io).readyState;
                    log('state = ' + state);
                    if (state && state.toLowerCase() == 'uninitialized')
                        setTimeout(checkState,50);
                }
                catch(e) {
                    log('Server abort: ' , e, ' (', e.name, ')');
                    cb(SERVER_ABORT);
                    if (timeoutHandle)
                        clearTimeout(timeoutHandle);
                    timeoutHandle = undefined;
                }
            }
380959
protected function check($name, $check = '')
    {
        if (!isset($this->keyMap[$name])) {
            return false;
        }
        return ($this->keyMap[$name]['checksum'] === $this->generateNewChecksum($check));
    }
757161
protected function respond($event, $error, $status, $payload = [])
    {
        $response = $this->events->fire($event, $payload, true);

        $jsonApiError = new JsonApiError(str_replace('_', ' ', $error));
        $jsonApiError->setStatusCode($status);

        return $response ?: $this->response->json(['errors' => [$jsonApiError]], $status);
    }
522706
public function pauseCheck($check_id) {
    $this->ensureParameters(array('check_id' => $check_id), __METHOD__);
    $check = array(
      'paused' => TRUE,
    );
    return $this->modifyCheck($check_id, $check);
  }
77648
def status_table(checkers)
      content_tag(:table, border: 1) do
        concat status_header
        checkers.each { |checker| concat status_row(checker) }
      end
    end
1092860
def event_exists(self, client, check):
        '''
        
        '''
        return self.api_request(
            'get',
            'events/{}/{}'.format(client, check)
            ).status_code == 200
710496
def checkStatus(self):
        
        checkAccount()

        data = {'userid': self.user_id,
                'useridx': self.useridx
               }
        r = self.session.post(nurls['checkStatus'], data = data)

        p = re.compile(r'\<message\>(?P<message>.+)\</message\>')
        message = p.search(r.text).group('message')

        if message == 'success':
            return True
        else:
            return False
163834
function checkStatus() {
  return server.ping(this, function(err, res) {
    if (err) {
      return out.error("error occurred: %j", err);
    }
    if (res.running) {
      return out.success("service running");
    }
    return out.error("service not running");
  });
}
733254
function delete_account_event( $check_user = true ) {
            $this->_logger->entrance( 'slug = ' . $this->_slug );

            if ( $check_user && ! $this->is_user_admin() ) {
                return;
            }

            $this->do_action( 'before_account_delete' );

            // Clear all admin notices.
            $this->_admin_notices->clear_all_sticky( false );

            $this->_delete_site( false );

            $delete_network_common_data = true;

            if ( $this->_is_network_active ) {
                $installs = $this->get_blog_install_map();

                // Don't delete common network data unless no other installs left.
                $delete_network_common_data = empty( $installs );
            }

            if ( $delete_network_common_data ) {
                $this->_delete_plans( false );

                $this->_delete_licenses( false );

                // Delete add-ons related to plugin's account.
                $this->_delete_account_addons( false );
            }

            // @todo Delete plans and licenses of add-ons.

            self::$_accounts->store();

            /**
             * IMPORTANT:
             *  Clear crons must be executed before clearing all storage.
             *  Otherwise, the cron will not be cleared.
             */
            if ( $delete_network_common_data ) {
                $this->clear_sync_cron();
            }

            $this->clear_install_sync_cron();

            // Clear all storage data.
            $this->_storage->clear_all( true, array(
                'connectivity_test',
                'is_on',
            ), false );

            // Send delete event.
            $this->get_api_site_scope()->call( '/', 'delete' );

            $this->do_action( 'after_account_delete' );
        }
1039626
public function showCheckSubmit($form_id = '', $list_input = [])
    {
        if ($form_id == '' || !(is_array($list_input)) || empty($list_input)) {
            return NULL;
        } else {
            $var       = '';
            $statement = '';
            foreach ($list_input as $key => $value) {
                $var       .= 'var ' . $key . ' = $(\'[name="' . $key . '"]\').val();';
                $statement .= $key . ' !== \'' . $value . '\' && ';
            }
            $statement    .= '1==1';
            $script_check = '';
            $script_check .= '$(document).ready(function() {';
            $script_check .= '$(window).load(function() {';
            $script_check .= '$(\'#' . $form_id . ' button[type="submit"]\').prop(\'disabled\', true);';
            $script_check .= '$(\'#' . $form_id . '\').on(\'change\', function () {';
            $script_check .= '$(\'#' . $form_id . ' button[type="submit"]\').prop(\'disabled\', true);';
            $script_check .= $var;
            $script_check .= 'if (' . $statement . ')';
            $script_check .= '{';
            $script_check .= '$(\'#' . $form_id . ' button[type="submit"]\').prop(\'disabled\', false);';
            $script_check .= '}';
            $script_check .= '});';
            $script_check .= '});';
            $script_check .= '});';

            return $script_check;
        }
    }
1166246
protected boolean setChecked(WebElement checkElement, WebElement clickElement,
            boolean checked) {
        log.debug("check.element", checkElement, clickElement, checked);
        if (checkElement.isSelected() != checked) {
            click(clickElement);
            return true;
        }
        return false;
    }
756008
public function readJson($check_header = true, $override = false)
	{
		if( !is_null($this->from_json) && !$override )
		{
			return $this->from_json;
		}

		// set false json reader
		$this->from_json = false;

		if( $check_header )
		{
			$type = $this->server->getIs("CONTENT_TYPE") ? $this->server->get("CONTENT_TYPE") : $this->server->getOr("HTTP_ACCEPT", '');
			if( ! preg_match('/(?:application|text)\/json(?:$|;| )/', $type) )
			{
				return false;
			}
		}

		$body = $this->body();
		if( strlen($body) && ( $body[0] === "{" || $body[0] === "[" ) )
		{
			$this->params_post = new Collection( Json::parse($body, true) );
			$this->body = '';
			$this->from_json = true;
		}

		return $this->from_json;
	}
735075
public static function checkConnections($connection_name, $table, $check)
    {
        if($check === true)
        {
            $connections = DB::connection($connection_name)->table($table)->get();

            foreach($connections as $connection)
            {
                $name = $connection->name;

                try{
                    $testConnection = DB::connection($name)->getPdo();
                }catch(\Exception $e)
                {
                    $error = $e->getMessage();
                    \error_log($error);
                }
                if(!empty($testConnection) && empty($error))
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => true]);
                }
                else
                {
                    $update = DB::connection($connection_name)->table($table)->where('name', $name)->update(['status' => false]);
                }
            }
        }
    }
32694
public static function isValid($status)
    {
        switch (strtolower($status)) {
        case strtolower(self::SUSPENDED):
        case strtolower(self::RUNNING):
        return true;

        default:
        return false;
        }
    }