public function activate($doiValue)
    {
        // validate client
        if (!$this->isClientAuthenticated()) {
            $this->setResponse('responsecode', 'MT009');
            return false;
        }

        //get the doi info
        $doi = $this->doiRepo->getByID($doiValue);
        $this->setResponse('doi', $doiValue);

        if ($doi === null) {
            $this->setResponse('responsecode', 'MT011');
            return true;
        }

        // check if this client owns this doi
        if (!$this->isDoiAuthenticatedClients($doiValue, $doi->client_id)) {
            $this->setResponse('responsecode', 'MT008');
            $this->setResponse('verbosemessage',$doiValue." is not owned by ".$this->getAuthenticatedClient()->client_name);
            return false;
        }

        $doi_xml = $doi->datacite_xml;

        //check if the doi is inactive
        if ($doi->status != 'INACTIVE') {
            $this->setResponse('responsecode', 'MT010');
            $this->setResponse('verbosemessage',
                'DOI ' . $doiValue . " not set to INACTIVE so cannot activate it");
            return false;
        }

        // activate using dataciteClient update method;
        $result = $this->dataciteClient->update($doi_xml);

        if ($result === true) {
            $this->setResponse('responsecode', 'MT004');
            //update the database DOIRepository
            $this->doiRepo->doiUpdate($doi, array('status'=>'ACTIVE'));
        } else {
            $this->setResponse('responsecode', 'MT010');
        }

        return $result;
    }
public function activate($doiValue)
    {
        // validate client
        if (!$this->isClientAuthenticated()) {
            $this->setResponse('responsecode', 'MT009');
            return false;
        }

        //get the doi info
        $doi = $this->doiRepo->getByID($doiValue);
        $this->setResponse('doi', $doiValue);

        if ($doi === null) {
            $this->setResponse('responsecode', 'MT011');
            return true;
        }

        // check if this client owns this doi
        if (!$this->isDoiAuthenticatedClients($doiValue, $doi->client_id)) {
            $this->setResponse('responsecode', 'MT008');
            $this->setResponse('verbosemessage',$doiValue." is not owned by ".$this->getAuthenticatedClient()->client_name);
            return false;
        }

        $doi_xml = $doi->datacite_xml;

        //check if the doi is inactive
        if ($doi->status != 'INACTIVE') {
            $this->setResponse('responsecode', 'MT010');
            $this->setResponse('verbosemessage',
                'DOI ' . $doiValue . " not set to INACTIVE so cannot activate it");
            return false;
        }

        // activate using dataciteClient update method;
        $result = $this->dataciteClient->update($doi_xml);

        if ($result === true) {
            $this->setResponse('responsecode', 'MT004');
            //update the database DOIRepository
            $this->doiRepo->doiUpdate($doi, array('status'=>'ACTIVE'));
        } else {
            $this->setResponse('responsecode', 'MT010');
        }

        return $result;
    }
public function activate ( $ doiValue ) { // validate client if ( ! $ this -> isClientAuthenticated ( ) ) { $ this -> setResponse ( 'responsecode' , 'MT009' ) ; return false ; } //get the doi info $ doi = $ this -> doiRepo -> getByID ( $ doiValue ) ; $ this -> setResponse ( 'doi' , $ doiValue ) ; if ( $ doi === null ) { $ this -> setResponse ( 'responsecode' , 'MT011' ) ; return true ; } // check if this client owns this doi if ( ! $ this -> isDoiAuthenticatedClients ( $ doiValue , $ doi -> client_id ) ) { $ this -> setResponse ( 'responsecode' , 'MT008' ) ; $ this -> setResponse ( 'verbosemessage' , $ doiValue . " is not owned by " . $ this -> getAuthenticatedClient ( ) -> client_name ) ; return false ; } $ doi_xml = $ doi -> datacite_xml ; //check if the doi is inactive if ( $ doi -> status != 'INACTIVE' ) { $ this -> setResponse ( 'responsecode' , 'MT010' ) ; $ this -> setResponse ( 'verbosemessage' , 'DOI ' . $ doiValue . " not set to INACTIVE so cannot activate it" ) ; return false ; } // activate using dataciteClient update method; $ result = $ this -> dataciteClient -> update ( $ doi_xml ) ; if ( $ result === true ) { $ this -> setResponse ( 'responsecode' , 'MT004' ) ; //update the database DOIRepository $ this -> doiRepo -> doiUpdate ( $ doi , array ( 'status' => 'ACTIVE' ) ) ; } else { $ this -> setResponse ( 'responsecode' , 'MT010' ) ; } return $ result ; }
Activate a DOI

@param $doiValue
@return bool|mixed
Activate a DOI