Get the venue tip groups.

@param Description $description The venue description.

@return TipGroup[]
970893
private function getTipGroups(Description $description)
    {
        $tipsDescription = $description->getOptionalProperty('tips');

        if (!($tipsDescription instanceof Description)) {
            return [];
        }

        return array_map(
            function (\stdClass $groupDescription) {
                return $this->tipGroupFactory->create(new Description($groupDescription));
            },
            $tipsDescription->getOptionalProperty('groups', [])
        );
    }
499259
private function getCoordinates(Description $description)
    {
        $latitude  = $description->getOptionalProperty('lat');
        $longitude = $description->getOptionalProperty('lng');

        if ($latitude === null || $longitude === null) {
            return null;
        }

        return new Coordinates($latitude, $longitude);
    }
1256606
public function get_group_list() {

        // No groups for system.
        if (empty($this->course)) {
            return array();
        }

        $context = context_course::instance($this->course->id);
        $groups = array();
        $groupmode = groups_get_course_groupmode($this->course);
        if (($groupmode == VISIBLEGROUPS) ||
                ($groupmode == SEPARATEGROUPS and has_capability('moodle/site:accessallgroups', $context))) {
            // Get all groups.
            if ($cgroups = groups_get_all_groups($this->course->id)) {
                foreach ($cgroups as $cgroup) {
                    $groups[$cgroup->id] = $cgroup->name;
                }
            }
        }
        return $groups;
    }
515715
public function setDescription($description)
    {
        if ((strlen($description) > 500)) {
            throw new \InvalidArgumentException('invalid length for $description when calling PostCharactersCharacterIdFittingsFitting., must be smaller than or equal to 500.');
        }
        if ((strlen($description) < 0)) {
            throw new \InvalidArgumentException('invalid length for $description when calling PostCharactersCharacterIdFittingsFitting., must be bigger than or equal to 0.');
        }

        $this->container['description'] = $description;

        return $this;
    }
484287
protected function getGroupFormFieldConfig($code)
    {
        if (!$code) {
            return null;
        }

        $fields = array_get($this->groupDefinitions, $code.'.fields');

        if (!$fields) {
            return null;
        }

        return ['fields' => $fields];
    }
1082244
public function links($venueId)
    {

        $resource = '/venues/' . $venueId . '/links';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'links')) {
            return $response->links->items;
        }

        return array();

    }
760478
public function description($description = null)
    {
        if ($description === null) {
            return $this->description;
        }

        $this->description = $description;
    }
504434
public function getSitesGroups()
    {
        $db = $this->getDb();
        $groups = $db->fetchAll("SELECT DISTINCT `group` FROM " . $this->table);

        $cleanedGroups = array();
        foreach ($groups as $group) {
            $cleanedGroups[] = $group['group'];
        }

        return $cleanedGroups;
    }
303857
public function generateHints($table)
    {
        $hints = [];
        foreach ($table->columns as $column) {
            if (!empty($column->comment)) {
                $hints[$column->name] = $column->comment;
            } else {
            }
        }

        return $hints;
    }
1279886
public function setAmateurDescriptions($descriptions)
    {
        foreach ($descriptions as $description) {
            $description->setVariety($this);
        }
        $this->amateur_descriptions = $descriptions;

        return $this;
    }
957614
private static function extractColumnsFromTableDescription(array $description): array
  {
    $ret = [];

    foreach ($description as $column)
    {
      preg_match('/^(\w+)(.*)?$/', $column['Type'], $parts1);

      $tmp = ['column_name'       => $column['Field'],
              'data_type'         => $parts1[1],
              'numeric_precision' => null,
              'numeric_scale'     => null,
              'dtd_identifier'    => $column['Type']];

      switch ($parts1[1])
      {
        case 'tinyint':
        case 'smallint':
        case 'mediumint':
        case 'int':
        case 'bigint':
          preg_match('/^\((\d+)\)/', $parts1[2], $parts2);
          $tmp['numeric_precision'] = (int)$parts2[1];
          $tmp['numeric_scale']     = 0;
          break;

        case 'year':
          // Nothing to do.
          break;

        case 'float':
          $tmp['numeric_precision'] = 12;
          break;

        case 'double':
          $tmp['numeric_precision'] = 22;
          break;

        case 'binary':
        case 'char':
        case 'varbinary':
        case 'varchar':
          // Nothing to do.
          break;

        case 'decimal':
          preg_match('/^\((\d+),(\d+)\)$/', $parts1[2], $parts2);
          $tmp['numeric_precision'] = (int)$parts2[1];
          $tmp['numeric_scale']     = (int)$parts2[2];;
          break;

        case 'time':
        case 'timestamp':
        case 'date':
        case 'datetime':
          // Nothing to do.
          break;

        case 'enum':
        case 'set':
          // Nothing to do.
          break;

        case 'bit':
          preg_match('/^\((\d+)\)$/', $parts1[2], $parts2);
          $tmp['numeric_precision'] = (int)$parts2[1];
          break;

        case 'tinytext':
        case 'text':
        case 'mediumtext':
        case 'longtext':
        case 'tinyblob':
        case 'blob':
        case 'mediumblob':
        case 'longblob':
          // Nothing to do.
          break;

        default:
          throw new FallenException('data type', $parts1[1]);
      }

      $ret[] = $tmp;
    }

    return $ret;
  }
810684
public function setDescription(string $description): Poll
    {
        $description = trim($description);
        $this->description = substr($description, 0, min(static::MAX_LENGTH_DESCRIPTION, strlen($description)));

        return $this;
    }
854619
public function setDescription($description) {
		if (is_array($description) && empty($description)) {
			$this->description = new \stdClass;
		} else {
			$this->description = $description;
		}

		return $this;
	}
1154366
public function prepareDescriptionForPersist($description)
    {
        $description = html_entity_decode($description);
        $description = strip_tags($description);
        $description = filter_var($description, FILTER_SANITIZE_STRING);

        // remove the encoded blank chars
        $description = str_replace("\xc2\xa0",'',$description);

        $description = trim($description);
        return $description;
    }
481872
public function lists($venueId)
    {

        $resource = '/venues/' . $venueId . '/listed';
        $response = $this->makeApiRequest($resource);

        if(property_exists($response, 'lists')) {
            return $response->lists->groups;
        }

        return array();

    }
9196
public function create(Description $description)
    {
        return new Venue(
            new Identifier($description->getMandatoryProperty('id')),
            $description->getMandatoryProperty('name'),
            $this->getCategories($description),
            $this->getTipGroups($description),
            $this->getPhotoGroups($description),
            $this->contactFactory->create($description->getMandatoryProperty('contact')),
            $this->locationFactory->create($description->getMandatoryProperty('location')),
            $this->detailFactory->create($description)
        );
    }
66191
protected function getHints()
	{
		$this->hintGenerator->setConfig($this->config);
		$this->hintGenerator->setPlugins($this->configurator->plugins);
		$this->hintGenerator->setXSL($this->xsl);

		return $this->hintGenerator->getHints();
	}