@param $ab_definition_id

@return bool
@throws Exception

API documentation: https://whatcounts.zendesk.com/hc/en-us/articles/204670055

@todo Find out how to get $ab_definition_id
@todo Create test in examples/
198185
public function chooseABWinner($ab_definition_id)
		{
			$form_data = array(
				'ab_definition_id' => $ab_definition_id
			);
			$xml = $this->call('abmailwinner', $form_data);

			$ab_test_statistics = new ABTestStatistics;

			return TRUE;
		}
1043673
public function getDefinition($id)
    {
        $id = $this->normalizeId($id);

        if (!isset($this->definitions[$id])) {
            throw new ServiceNotFoundException($id);
        }

        return $this->definitions[$id];
    }
1135172
public function getMethodDefinitionId(MethodDoc $method, $definitionType) : string
    {
        $base = 'UNKNONWN_METHOD-%s';
        switch ($definitionType) {
            case self::METHOD_RESULT_DEFINITION_TYPE:
                $base = 'Method-%s-Result';
                break;
            case self::METHOD_PARAMS_DEFINITION_TYPE:
                $base = 'Method-%s-RequestParams';
                break;
        }

        return sprintf($base, $method->getIdentifier());
    }
940341
public function getAccountId()
    {
        $segments = $this->getSegments();

        if (reset($segments) === 'account' && isset($segments[1]) && ctype_digit($segments[1])) {
            return (int) $segments[1];
        }

        return false;
    }
1107417
public String getDefinitionForID(String id) {
        if (!terms.containsKey(id))
            return null;
        return terms.get(id).getDef();
    }
135183
public function identify(Exception $exception)
    {
        $hash = spl_object_hash($exception);

        // if we know about the exception, return it's id
        if (isset($this->identification[$hash])) {
            return $this->identification[$hash];
        }

        // cleanup in preparation for the identification
        if (count($this->identification) >= 16) {
            array_shift($this->identification);
        }

        // generate, store, and return the id
        return $this->identification[$hash] = $this->generate();
    }
982615
private function isSimpleInstance($id, Definition $definition)
    {
        foreach (array_merge(array($definition), $this->getInlinedDefinitions($definition)) as $sDefinition) {
            if ($definition !== $sDefinition && !$this->hasReference($id, $sDefinition->getMethodCalls())) {
                continue;
            }

            if ($sDefinition->getMethodCalls() || $sDefinition->getProperties() || $sDefinition->getConfigurator()) {
                return false;
            }
        }

        return true;
    }
273057
public function getOneById($id)
    {
        $plugin = $this->getById($id);
        if (!$plugin) {
            throw new Exception(sprintf('Plugin "%s" not found', $id));
        }

        return $plugin;
    }
461270
public function getIdFromCookie()
    {
        if (empty($_COOKIE[$this->name])) {
            return false;
        }
        $id = $_COOKIE[$this->name];
        if (!is_string($id) || !$this->isValidId($id)) {
            return false;
        }
        return $id;
    }
1341831
private function getDefinition($id)
    {
        $id = $this->getDefinitionId($id);

        return null === $id ? null : $this->container->getDefinition($id);
    }
256287
public function has($id)
    {
        try {
             $em = $this->entityManager->getDoctrineEntityManager();
             $data = $em->getRepository($this->getEntityClass())->findOneBy(array(
                 'id' => $id,
             ));
             
             if ($data !== null) {
                 return true;
             }
             
             return false;
        } catch (\Exception $e) {
            throw new Exception('Cannot check if there is an entity for the given id "' . $id . '".', 0, $e);
        }
    }
258831
public function showABDefinitions()
		{
			$xml = $this->call('show_abdefinitions');

			$ab_tests = array();

			foreach ($xml->Data as $ab_test_item) {
				$ab_test = new ABTest;

				$is_testing_subject = $ab_test_item->test_subject == '1' ? TRUE : FALSE;
				$is_testing_from_address = $ab_test_item->test_from_address == '1' ? TRUE : FALSE;
				$is_testing_content = $ab_test_item->test_content == '1' ? TRUE : FALSE;
				$ab_test
					->setId((int)$ab_test_item->id)
					->setName((string)$ab_test_item->name)
					->setDescription((string)$ab_test_item->description)
					->setListId((int)$ab_test_item->list_id)
					->setListName((string)$ab_test_item->list_name)
					->setSegmentationRuleId((int)$ab_test_item->segmentation_rule_id)
					->setSuppressionList((string)$ab_test_item->suppression_list)
					->setMaxTime((int)$ab_test_item->max_time)
					->setMeasuring((string)$ab_test_item->measuring)
					->setNumSamples((int)$ab_test_item->num_samples)
					->setSampleSize((int)$ab_test_item->sample_size)
					->setSampleType((string)$ab_test_item->sample_type)
					->setTestSubject((boolean)$is_testing_subject)
					->setTestFromAddress((boolean)$is_testing_from_address)
					->setTestContent((boolean)$is_testing_content)
					->setTestEndsWhen((string)$ab_test_item->test_ends_when)
					->setThreshold((int)$ab_test_item->threshold)
					->setPostTestAction((string)$ab_test_item->post_test_action);
				$ab_tests[] = $ab_test;
			}

			return $ab_tests;
		}
125159
static function get_instance_by_id( $id ) {
            return isset ( self::$_instances[ 'm_' . $id ] ) ?
                self::$_instances[ 'm_' . $id ] :
                false;
        }
1067073
public function getId() {
    if (empty($this->record[$this->id_name])) {
      return FALSE;
    }

    return $this->record[$this->id_name];
  }
1130293
public function getId()
    {
        if (!self::$session) {
            Exception::i()->setMessage(self::ERROR_NOT_STARTED)->trigger();
        }

        return session_id();
    }
1132924
protected function _extractId()
    {
		list(, $className) = namespaceSplit(get_class($this));
		$id = explode('Layout', $className)[0];

		if (!$className || !$id) {
			user_error(__d('wasabi_cms', 'The layout Class {0} has an invalid name. The name has to end with "Layout".', $className));
		}

		return $id;
	}
1233860
public function getDefinition($id)
    {
        $id = (string) $id;

        if (!isset($this->definitions[$id])) {
            throw new ServiceNotFoundException($id);
        }

        return $this->definitions[$id];
    }