original_string: protected function build_tool_consumer_object($record, ToolConsumer $consumer) {
          $consumer->setRecordId($record->id);
          $consumer->name = $record->name;
          $key = empty($record->consumerkey) ? $record->consumerkey256 : $record->consumerkey;
          $consumer->setKey($key);
          $consumer->secret = $record->secret;
          $consumer->ltiVersion = $record->ltiversion;
          $consumer->consumerName = $record->consumername;
          $consumer->consumerVersion = $record->consumerversion;
          $consumer->consumerGuid = $record->consumerguid;
          $consumer->profile = json_decode($record->profile);
          $consumer->toolProxy = $record->toolproxy;
          $settings = unserialize($record->settings);
          if (!is_array($settings)) {
              $settings = array();
          }
          $consumer->setSettings($settings);
          $consumer->protected = $record->protected == 1;
          $consumer->enabled = $record->enabled == 1;
          $consumer->enableFrom = null;
          if (!is_null($record->enablefrom)) {
              $consumer->enableFrom = $record->enablefrom;
          }
          $consumer->enableUntil = null;
          if (!is_null($record->enableuntil)) {
              $consumer->enableUntil = $record->enableuntil;
          }
          $consumer->lastAccess = null;
          if (!is_null($record->lastaccess)) {
              $consumer->lastAccess = $record->lastaccess;
          }
          $consumer->created = $record->created;
          $consumer->updated = $record->updated;
      }
code: protected function build_tool_consumer_object($record, ToolConsumer $consumer) {
          $consumer->setRecordId($record->id);
          $consumer->name = $record->name;
          $key = empty($record->consumerkey) ? $record->consumerkey256 : $record->consumerkey;
          $consumer->setKey($key);
          $consumer->secret = $record->secret;
          $consumer->ltiVersion = $record->ltiversion;
          $consumer->consumerName = $record->consumername;
          $consumer->consumerVersion = $record->consumerversion;
          $consumer->consumerGuid = $record->consumerguid;
          $consumer->profile = json_decode($record->profile);
          $consumer->toolProxy = $record->toolproxy;
          $settings = unserialize($record->settings);
          if (!is_array($settings)) {
              $settings = array();
          }
          $consumer->setSettings($settings);
          $consumer->protected = $record->protected == 1;
          $consumer->enabled = $record->enabled == 1;
          $consumer->enableFrom = null;
          if (!is_null($record->enablefrom)) {
              $consumer->enableFrom = $record->enablefrom;
          }
          $consumer->enableUntil = null;
          if (!is_null($record->enableuntil)) {
              $consumer->enableUntil = $record->enableuntil;
          }
          $consumer->lastAccess = null;
          if (!is_null($record->lastaccess)) {
              $consumer->lastAccess = $record->lastaccess;
          }
          $consumer->created = $record->created;
          $consumer->updated = $record->updated;
      }
code_tokens: protected function build_tool_consumer_object ( $ record , ToolConsumer $ consumer ) { $ consumer -> setRecordId ( $ record -> id ) ; $ consumer -> name = $ record -> name ; $ key = empty ( $ record -> consumerkey ) ? $ record -> consumerkey256 : $ record -> consumerkey ; $ consumer -> setKey ( $ key ) ; $ consumer -> secret = $ record -> secret ; $ consumer -> ltiVersion = $ record -> ltiversion ; $ consumer -> consumerName = $ record -> consumername ; $ consumer -> consumerVersion = $ record -> consumerversion ; $ consumer -> consumerGuid = $ record -> consumerguid ; $ consumer -> profile = json_decode ( $ record -> profile ) ; $ consumer -> toolProxy = $ record -> toolproxy ; $ settings = unserialize ( $ record -> settings ) ; if ( ! is_array ( $ settings ) ) { $ settings = array ( ) ; } $ consumer -> setSettings ( $ settings ) ; $ consumer -> protected = $ record -> protected == 1 ; $ consumer -> enabled = $ record -> enabled == 1 ; $ consumer -> enableFrom = null ; if ( ! is_null ( $ record -> enablefrom ) ) { $ consumer -> enableFrom = $ record -> enablefrom ; } $ consumer -> enableUntil = null ; if ( ! is_null ( $ record -> enableuntil ) ) { $ consumer -> enableUntil = $ record -> enableuntil ; } $ consumer -> lastAccess = null ; if ( ! is_null ( $ record -> lastaccess ) ) { $ consumer -> lastAccess = $ record -> lastaccess ; } $ consumer -> created = $ record -> created ; $ consumer -> updated = $ record -> updated ; }
docstring: Builds a ToolConsumer object from a record object from the DB.
  
  @param stdClass $record The DB record object.
  @param ToolConsumer $consumer
docstring_tokens: Builds a ToolConsumer object from a record object from the DB .