Permite a definição do usuário ativo.

@param int $responsibleId
421841
public function setActiveResponsible(Model $Model, $responsibleId)
	{
		if (empty($responsibleId)) {
			return false;
		}

		$this->activeResponsibleId = $responsibleId;

		return true;
	}
768851
public function init($pageId)
    {
        if (!$this->layoutSetup instanceof LayoutSetup) {
            $this->injectLayoutSetup(GeneralUtility::makeInstance(LayoutSetup::class)->init($pageId));
        }
    }
308155
public static function count_competencies_in_course($courseid) {
        static::require_enabled();
        // Check the user have access to the course.
        self::validate_course($courseid);

        // First we do a permissions check.
        $context = context_course::instance($courseid);

        $capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
        if (!has_any_capability($capabilities, $context)) {
             throw new required_capability_exception($context, 'moodle/competency:coursecompetencyview', 'nopermissions', '');
        }

        // OK - all set.
        return course_competency::count_competencies($courseid);
    }
1173611
public function init( $config = NULL )
    {
        parent::init( $config );

        if ( isset( $config[ 'id' ] ) )
        {
            $this->id = ( int )$config[ 'id' ];
        }

        $this->doAction( self::ON_MODEL_INIT_ACTION );
    }
450156
public function startSession($sessionId = NULl){
        if($sessionId != NULL){ 
            session_id($sessionId);
        }
        session_start();
        $this->checkIdentity();
    }
472977
public function delete($accountId, $permissionId, $optParams = array())
  {
    $params = array('accountId' => $accountId, 'permissionId' => $permissionId);
    $params = array_merge($params, $optParams);
    return $this->call('delete', array($params));
  }
1239072
public static function add_related_competency($competencyid, $relatedcompetencyid) {
        static::require_enabled();
        $competency1 = new competency($competencyid);
        $competency2 = new competency($relatedcompetencyid);

        require_capability('moodle/competency:competencymanage', $competency1->get_context());

        $relatedcompetency = related_competency::get_relation($competency1->get('id'), $competency2->get('id'));
        if (!$relatedcompetency->get('id')) {
            $relatedcompetency->create();
            return true;
        }

        return true;
    }
67736
public function edit($id = null) {
		if (!$this->IvaResponsabilidad->exists($id)) {
			throw new NotFoundException(__('Invalid iva responsabilidad'));
		}
		if ($this->request->is(array('post', 'put'))) {
			if ($this->IvaResponsabilidad->save($this->request->data)) {
				$this->Session->setFlash(__('The iva responsabilidad has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The iva responsabilidad could not be saved. Please, try again.'));
			}
		} else {
			$options = array('conditions' => array('IvaResponsabilidad.' . $this->IvaResponsabilidad->primaryKey => $id));
			$this->request->data = $this->IvaResponsabilidad->find('first', $options);
		}
		$tipoFacturas = $this->IvaResponsabilidad->TipoFactura->find('list');
		$this->set(compact('tipoFacturas'));
	}
1104606
public function handleOpen(int $userId) : void
    {
        if ($this->presenter->isAjax())
        {
            if (!$this->presenter->user->isAllowed(UserAuthorizator::RES_EDIT_MODAL))
            {
                throw new ForbiddenRequestException;
            }

            $this->userId = $userId;

            $this->presenter->handleModalToggle('show', '#wakers_user_edit_modal', FALSE);

            $this->onOpen();
        }
    }
344910
public function setDatatableId($id)
    {
        if (!array_key_exists($id, self::$_instances))
        {
            self::$_instances[$id] = $this;
        }
        else
        {
            throw new \Exception('Identifer already exists');
        }
        return $this;
    }
525891
public function setTypeId( $typeid )
	{
		if ( $typeid == $this->getTypeId() ) { return; }

		$this->_values['typeid'] = (int) $typeid;
		$this->setModified();
	}
1219188
public function create($installedAddOnSid) {
        $data = Values::of(array('InstalledAddOnSid' => $installedAddOnSid, ));

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new AssignedAddOnInstance(
            $this->version,
            $payload,
            $this->solution['accountSid'],
            $this->solution['resourceSid']
        );
    }
205917
public function handleOpen(int $id) : void
    {
        if ($this->presenter->isAjax())
        {
            $this->categoryEntity = $this->categoryRepository->findOneById($id);

            $this->presenter->handleModalToggle('show', '#wakers_category_remove_modal', FALSE);
            $this->onOpen();
        }
    }
6867
public static function add_competency_to_course($courseid, $competencyid) {
        static::require_enabled();
        // Check the user have access to the course.
        self::validate_course($courseid);

        // First we do a permissions check.
        $context = context_course::instance($courseid);

        require_capability('moodle/competency:coursecompetencymanage', $context);

        $record = new stdClass();
        $record->courseid = $courseid;
        $record->competencyid = $competencyid;

        $competency = new competency($competencyid);

        // Can not add a competency that belong to a hidden framework.
        if ($competency->get_framework()->get('visible') == false) {
            throw new coding_exception('A competency belonging to hidden framework can not be linked to course');
        }

        $coursecompetency = new course_competency();
        $exists = $coursecompetency->get_records(array('courseid' => $courseid, 'competencyid' => $competencyid));
        if (!$exists) {
            $coursecompetency->from_record($record);
            if ($coursecompetency->create()) {
                return true;
            }
        }
        return false;
    }
435342
public function assignRole($roleId = null)
    {
        $roles = $this->roles;

        if (! $roles->contains($roleId)) {
            return $this->roles()->attach($roleId);
        }

        return false;
    }
1353544
public function prepareCreateInToManyRelationship(
        string $relationshipName,
        string $identity,
        string $secondaryIdBindName
    ): self {
        list ($intermediateTable, $primaryKey, $secondaryKey) =
            $this->getModelSchemas()->getBelongsToManyRelationship($this->getModelClass(), $relationshipName);

        $this
            ->insert($this->quoteSingleIdentifier($intermediateTable))
            ->values([
                $this->quoteSingleIdentifier($primaryKey)   => $this->createNamedParameter($identity),
                $this->quoteSingleIdentifier($secondaryKey) => $secondaryIdBindName,
            ]);

        return $this;
    }
555310
public function setContactId($contactId)
    {
        if ($contactId instanceof Lead) {
            $this->setContact($contactId);
        } elseif (\is_int($contactId)) {
            $this->contactId = $contactId;
        } else {
            throw new \InvalidArgumentException(
                '$contact must be an integer or instance of "\\Mautic\\LeadBundle\\Entity\\Lead"'
            );
        }

        return $this;
    }