Return the assignment option.

@return int
486569
public function getAssignmentForIdentifier($identifier)
    {
        $assignment = $this->assignments->find(array('actortype' => (string) $identifier));
        $access = ($assignment) ? $assignment->access : self::ACCESS_NEVER;

        return (int) $access;
    }
874238
public function getOptionsForConsole()
    {
        $builder = '';

        foreach ($this->options as $option => $value) {
            $builder .= '--' . $option;

            if ($value) {
                $builder .= '=' . $value;
            }

            $builder .= ' ';
        }

        return $builder;
    }
925019
public function get_assign() {
        if ($this->is_restored()) {
            throw new \coding_exception('get_assign() is intended for event observers only');
        }
        if (!isset($this->assign)) {
            debugging('assign property should be initialised in each event', DEBUG_DEVELOPER);
            global $CFG;
            require_once($CFG->dirroot . '/mod/assign/locallib.php');
            $cm = get_coursemodule_from_id('assign', $this->contextinstanceid, 0, false, MUST_EXIST);
            $course = get_course($cm->course);
            $this->assign = new \assign($this->get_context(), $cm, $course);
        }
        return $this->assign;
    }
974016
protected function getOptions()
	{
		// Initialise variables.
		$options = array();
		$name = (string) $this->element['name'];

		// Let's get the id for the current item, either category or content item.
		$jinput = JFactory::getApplication()->input;

		// For categories the old category is the category id 0 for new category.
		if ($this->element['parent'])
		{
			$oldCat = $jinput->get('id', 0);
		}
		else
			// For items the old category is the category they are in when opened or 0 if new.
		{
			$oldCat = $this->form->getValue($name);
		}

		$db = JFactory::getDbo();
		$query = $db->getQuery(true)
			->select('a.id AS value, a.title AS text, a.level')
			->from('#__categories AS a')
			->join('LEFT', $db->quoteName('#__categories') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt');

		// Filter by the type
		if ($extension = $this->form->getValue('extension'))
		{
			$query->where('(a.extension = ' . $db->quote($extension) . ' OR a.parent_id = 0)');
		}

		if ($this->element['parent'])
		{
			// Prevent parenting to children of this item.
			if ($id = $this->form->getValue('id'))
			{
				$query->join('LEFT', $db->quoteName('#__categories') . ' AS p ON p.id = ' . (int) $id)
					->where('NOT(a.lft >= p.lft AND a.rgt <= p.rgt)');

				$rowQuery = $db->getQuery(true);
				$rowQuery->select('a.id AS value, a.title AS text, a.level, a.parent_id')
					->from('#__categories AS a')
					->where('a.id = ' . (int) $id);
				$db->setQuery($rowQuery);
				$row = $db->loadObject();
			}
		}

		$query->where('a.published IN (0,1)')
			->group('a.id, a.title, a.level, a.lft, a.rgt, a.extension, a.parent_id')
			->order('a.lft ASC');

		// Get the options.
		$db->setQuery($query);

		try
		{
			$options = $db->loadObjectList();
		}
		catch (RuntimeException $e)
		{
			JError::raiseWarning(500, $e->getMessage());
		}

		// Pad the option text with spaces using depth level as a multiplier.
		for ($i = 0, $n = count($options); $i < $n; $i++)
		{
			// Translate ROOT
			if ($options[$i]->level == 0)
			{
				$options[$i]->text = JText::_('JGLOBAL_ROOT_PARENT');
			}

			// Displays language code if not set to All
			$db = JFactory::getDbo();
			$query = $db->getQuery(true)
				->select($db->quoteName('language'))
				->where($db->quoteName('id') . '=' . (int) $options[$i]->value)
				->from($db->quoteName('#__categories'));

			$db->setQuery($query);
			$language = $db->loadResult();

			$options[$i]->text = str_repeat('- ', $options[$i]->level) . $options[$i]->text;

			if ($language !== '*')
			{
				$options[$i]->text = $options[$i]->text . ' (' . $language . ')';
			}
		}

		// Get the current user object.
		$user = JFactory::getUser();

		// For new items we want a list of categories you are allowed to create in.
		if ($oldCat == 0)
		{
			foreach ($options as $i => $option)
			{
				/*
				 * To take save or create in a category you need to have create rights for that category unless the item is already in that category.
				 * Unset the option if the user isn't authorised for it. In this field assets are always categories.
				 */
				if ($user->authorise('core.create', $extension . '.category.' . $option->value) != true)
				{
					unset($options[$i]);
				}
			}
		}
		// If you have an existing category id things are more complex.
		else
		{
			foreach ($options as $i => $option)
			{
				/*
				 * If you are only allowed to edit in this category but not edit.state, you should not get any
				 * option to change the category parent for a category or the category for a content item,
				 * but you should be able to save in that category.
				 */
				if ($user->authorise('core.edit.state', $extension . '.category.' . $oldCat) != true)
				{
					if ($option->value != $oldCat)
					{
						echo 'y';
						unset($options[$i]);
					}
				}
				/*
				 * However, if you can edit.state you can also move this to another category for which you have
				 * create permission and you should also still be able to save in the current category.
				 */
				elseif (($user->authorise('core.create', $extension . '.category.' . $option->value) != true)
					&& $option->value != $oldCat
				)
				{
					echo 'x';
					unset($options[$i]);
				}
			}
		}

		if (isset($row) && !isset($options[0]))
		{
			if ($row->parent_id == '1')
			{
				$parent = new stdClass;
				$parent->text = JText::_('JGLOBAL_ROOT_PARENT');
				array_unshift($options, $parent);
			}
		}

		// Merge any additional options in the XML definition.
		return array_merge(parent::getOptions(), $options);
	}
310966
public function getChoices()
    {
        /** @var ApiChoice $constraint */
        if ($constraint = $this->docBlockUtility->getConstraint($this->property, ApiChoice::class)) {
            return $constraint->choices;
        }
    }
1371997
public function count()
    {
        return ( self::$assigned[$this->type] - self::START_AT + self::INCREMENT ) / self::INCREMENT;
    }
287429
public function get_value() {
		$config = $this->options->get( $this->options_key );
		$value  = $config[ $this->id ];

		// Make sure $value is in $option_values if $option_values is set.
		if ( isset( $this->option_values ) && ! isset( $this->option_values[ $value ] ) ) {
			$value = null;
		}

		return $value;
	}
1132313
protected function getOptions()
	{
		$options = array();

		foreach ($this->element->children() as $option)
		{
			// Only add <option /> elements.
			if ($option->getName() != 'option')
			{
				continue;
			}

			// Create a new option object based on the <option /> element.
			$tmp = HtmlSelect::option(
				(string) $option['value'],
				Text::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
				((string) $option['disabled'] == 'true')
			);

			// Set some option attributes.
			$tmp->class = (string) $option['class'];

			// Set some JavaScript option attributes.
			$tmp->onclick = (string) $option['onclick'];

			// Add the option object to the result set.
			$options[] = $tmp;
		}

		reset($options);

		return $options;
	}
383305
public function get_instance() {
        global $DB;
        if ($this->instance) {
            return $this->instance;
        }
        if ($this->get_course_module()) {
            $params = array('id' => $this->get_course_module()->instance);
            $this->instance = $DB->get_record('assign', $params, '*', MUST_EXIST);
        }
        if (!$this->instance) {
            throw new coding_exception('Improper use of the assignment class. ' .
                                       'Cannot load the assignment record.');
        }
        return $this->instance;
    }
874775
public function setOption()
    {
        $args = func_get_args();

        $options = [];

        if (is_array($args[0])) {
            foreach ($args[0] as $key => $value)
                $options[$key] = $value;
        } else {
            $options[$args[0]] = $args[1];
        }

        $this->options += $options;

        return $this;
    }
238488
protected function getDestination()
    {
        if (!is_null($this->input->getOption('destination'))) {
            return $this->input->getOption('destination');
        }

        return implode(DIRECTORY_SEPARATOR, array(Strata::getRootPath(), "doc", DIRECTORY_SEPARATOR));
    }
159015
public function maybeShowOptionNone()
    {
        if (isset($this->args['show_option_none']) && ! Cuztom::isEmpty($this->args['show_option_none'])) {
            return '<option value="-1" '.(Cuztom::isEmpty($this->value) ? 'selected="selected"' : '').'>'.$this->args['show_option_none'].'</option>';
        }
    }
1185631
public function value() {
		if($this->getOption('disabled'))
			return isset($this->options['default']) ? $this->options['default']:null;
		return $this->value;
	}
1192403
public function getOptions()
    {
        $types = $this->types();

        array_walk($types, function (&$classname) {
            $classname = $classname::getLabel();
        });

        return $types;
    }
924326
public function getOption($option) {
        return isset($this->_options[$option]) ?
            $this->_options[$option] :
            null;
    }
747948
public function getOptionCAML () {

		$xml = '';

		// if fields are specified
		if(sizeof($this->fields) > 0) {
			$xml .= $this->api->viewFieldsXML($this->fields);
		}
		
		// If view, add to xml.
		if($this->view !== NULL) $xml .= '<viewName>' . $this->view . '</viewName>';
			
		return $xml;
	}
395111
private function _getopt()
    {
        $shortopts  = OptionConfig::HELP;  // help
        $shortopts .= OptionConfig::PLATFORM . ':';          // platform
        $shortopts .= OptionConfig::OUTPUT_DIR . ':';        // output dir.
        $shortopts .= OptionConfig::SELENIUM_VER . ':';      // Selenium-Standalone-Server Ver.
        $shortopts .= OptionConfig::CHROME_DRIVER_VER . ':'; // ChromeDriver Ver.
        $shortopts .= OptionConfig::GECKO_DRIVER_VER . ':';  // GeckoDriver Ver.
        $shortopts .= OptionConfig::IE_DRIVER_VER . ':';     // IEDriverServer Ver.
        $shortopts .= OptionConfig::OS_BIT_VER . ':';        // bit of OS (Default 32).

        $longopts = array(
            OptionConfig::HELP_LONG . '::', // help
        );

        return getopt($shortopts, $longopts);
    }