Return the activity type that was performed.

Convenience method that inspects category where scheme is
http://gdata.youtube.com/schemas/2007/userevents.cat.

@return string|null The activity category if found.
483367
public function getActivityType()
    {
        $categories = $this->getCategory();
        foreach($categories as $category) {
            if ($category->getScheme() == self::ACTIVITY_CATEGORY_SCHEME) {
                return $category->getTerm();
            }
        }
        return null;
    }
737794
public static function GetActiveCategoryPath()
    {
        static $aCategoryList;
        if (!isset($aCategoryList)) {
            $aCategoryList = null;
            $oCurrentCategory = self::getShopService()->getActiveCategory();
            if (!is_null($oCurrentCategory)) {
                $aCategoryList = array();
                do {
                    $aCategoryList[$oCurrentCategory->id] = $oCurrentCategory;
                } while ($oCurrentCategory = &$oCurrentCategory->GetParent());
                $aCategoryList = array_reverse($aCategoryList, true);
            }
        }

        return $aCategoryList;
    }
549704
public function getRequestedPostType()
    {
        if (!is_a($this->query, 'WP_Query')) {
            return null;
        }

        if (isset($this->query->query) && isset($this->query->query['post_type'])) {
            return $this->data['post_type'] = $this->query->query['post_type'];
        } else {
            return $this->data['post_type'] = null;
        }
    }
164983
protected ScopeImpl getScopeActivity() {
    ScopeImpl scope = null;
    // this if condition is important during process instance startup
    // where the activity of the process instance execution may not be aligned
    // with the execution tree
    if (isProcessInstanceExecution()) {
      scope = getProcessDefinition();
    } else {
      scope = getActivity();
    }
    return scope;
  }
816007
public function getCategory() : ?string 
    {
        if ( ! $this->hasCategory()) {
            $this->setCategory($this->getDefaultCategory());
        }
        return $this->category;
    }
1094748
public function getPlaylistVideoFeedUrl()
    {
        if ($this->getMajorProtocolVersion() >= 2) {
            return $this->getContent()->getSrc();
        } else {
            return $this->getFeedLink(Zend_Gdata_YouTube::PLAYLIST_REL)->href;
        }
    }
751938
def get_category_activities(self, category_id = None):
        """"""
        category_id = category_id or -1
        return self._to_dict(('id', 'name', 'category_id', 'category'), self.conn.GetCategoryActivities(category_id))
1359670
protected function _findActivityActor()
    {
        $user = $this->getObject('user.provider')->fetch($this->created_by);

        return is_null($user) ? false : true;
    }
809058
public function getUpdateType()
    {
        $update = $this->data;
        if (isset($update['inline_query'])) {
            return self::INLINE_QUERY;
        }
        if (isset($update['callback_query'])) {
            return self::CALLBACK_QUERY;
        }
        if (isset($update['edited_message'])) {
            return self::EDITED_MESSAGE;
        }
        if (isset($update['message']['text'])) {
            return self::MESSAGE;
        }
        if (isset($update['message']['photo'])) {
            return self::PHOTO;
        }
        if (isset($update['message']['video'])) {
            return self::VIDEO;
        }
        if (isset($update['message']['audio'])) {
            return self::AUDIO;
        }
        if (isset($update['message']['voice'])) {
            return self::VOICE;
        }
        if (isset($update['message']['contact'])) {
            return self::CONTACT;
        }
        if (isset($update['message']['location'])) {
            return self::LOCATION;
        }
        if (isset($update['message']['reply_to_message'])) {
            return self::REPLY;
        }
        if (isset($update['message']['animation'])) {
            return self::ANIMATION;
        }
        if (isset($update['message']['document'])) {
            return self::DOCUMENT;
        }
        if (isset($update['channel_post'])) {
            return self::CHANNEL_POST;
        }

        return false;
    }
143158
protected function get_activity() {
        if ($this->activity === false) {
            $this->activity = $this->reorder_activities();
        }
        return $this->activity;
    }
407621
public function getMimeType(): ?string
	{
		$info = finfo_open(FILEINFO_MIME_TYPE);

		$mime = finfo_file($info, $this->getPathname());

		finfo_close($info);

		return $mime ?: null;
	}
582423
public LRActivity getActivity(){
		LRActivity activity = new LRActivity(getResourceURL(), getSubmitter().getSubmitter(), getSubmitter().getSubmitterType(), getSubmitter().getSubmissionTOS(), getSubmitter().getSubmissionAttribution(), getSubmitter().getSigner());
		if (getActor() != null)
			activity.addActor("actor", getActor().getName(), getActor().getUrl(), null);
		activity.addVerb(getAction().getVerb(), null, null, null, null);
		if (this.action.getContextUrl() != null){
			activity.addContextToVerb("Widget", this.action.getContextUrl(), "Detail page");
		}
		activity.addContent(getAction().getContent());
		getAction().addMeasure(activity);
		activity.addObject(null, null, getResourceURL());
		return activity;
	}
408886
public function getMediaPlayerAttribute()
    {
        if (!in_array($this->attributes['type'], ['video', 'audio'])) {
            return null;
        }

        return html_raw(view('shortcodes.media_player', [
            'media' => (object) $this->toArray()
        ]));
    }
1305124
public function selectRunningActivity()
	{
		$stmt = $this->pdo->prepare(<<<EOT
SELECT 
	t1.*,
	t2.ProjectId AS "Project.ProjectId",
	t2.Name AS "Project.Name",
	t2.Description AS "Project.Description",
	t2.Created AS "Project.Created"
FROM `$this->tableName` AS t1 
LEFT JOIN Projects AS t2 ON t1.ProjectId = t2.ProjectId 
WHERE t1.Stopped IS NULL OR t1.Stopped = '' 
LIMIT 1 ;
EOT
		);
		$res = $stmt->execute();

		if ($res === false) {
			return null;
		}

		$row = $stmt->fetch();

		if (!is_array($row)) {
			return null;
		}

		return $this->prepareEntity($row);
	}
352370
public function getMediaType()
    {
        $contentType = $this->getContentType();
        if (is_string($contentType)) {
            $contentTypeParts = preg_split('/\s*[;,]\s*/', $contentType);

            return isset($contentTypeParts[0]) ? strtolower($contentTypeParts[0]) : null;
        }

        return null;
    }
388608
public function getClassOptions() {
    static $options = [];

    $category = $this->state['category'];
    if (!$options) {
      $options = ['all' => $this->t('All')];

      // Get activities ids.
      if ($category == 'all') {
        $categories_ids = array_keys($this->getCategoryOptions());
      }
      else {
        $categories_ids = [$category];
      }
      $query = $this->entityQuery
        ->get('node')
        ->condition('status', 1)
        ->condition('type', 'activity')
        ->condition('field_activity_category', $categories_ids, 'IN');
      $activities_ids = $query->execute();

      if ($activities_ids) {
        // Get classes.
        $query = $this->entityQuery
          ->get('node')
          ->condition('status', 1)
          ->condition('type', 'class')
          ->condition('field_class_activity', $activities_ids, 'IN')
          ->sort('title');
        $entity_ids = $query->execute();

        if ($entity_ids) {
          $nodes = $this->entityTypeManager->getStorage('node')->loadMultiple($entity_ids);
          foreach ($entity_ids as $id) {
            $options[$id] = $nodes[$id]->getTitle();
          }
        }
      }
    }

    return $options;
  }
759513
public function get_owning_activity() {
        global $DB;

        // Set some defaults.
        $result = new stdClass();
        $result->id = 0;

        if (empty($this->instance->parentcontextid)) {
            return $result;
        }
        $parentcontext = context::instance_by_id($this->instance->parentcontextid);
        if ($parentcontext->contextlevel != CONTEXT_MODULE) {
            return $result;
        }
        $cm = get_coursemodule_from_id($this->page->cm->modname, $parentcontext->instanceid);
        if (!$cm) {
            return $result;
        }
        // Get the grade_items id.
        $rec = $DB->get_record('grade_items', array('iteminstance' => $cm->instance, 'itemmodule' => $this->page->cm->modname));
        if (!$rec) {
            return $result;
        }
        // See if it is a gradable activity.
        if (($rec->gradetype != GRADE_TYPE_VALUE) && ($rec->gradetype != GRADE_TYPE_SCALE)) {
            return $result;
        }
        return $rec;
    }