Reads a single entity. Emits a 'read' event.

@param {Number} id to read
@param {Function} callback (optional)
@api public
558268
function read(id, callback) {
    var query = {}

    self.emit('read', id)
    callback = callback || emptyFn
    query[options.idProperty] = '' + id
    findByQuery(query, {}, function (error, objects) {
      if (objects[0] !== undefined) {
        var cloned = extend({}, objects[0])
        self.emit('received', cloned)
        callback(undefined, cloned)
      } else {
        callback(undefined, undefined)
      }
    })
  }
879771
function _read(callback) {
      glob(path.join(process.cwd(), pathToCode, '/*'), {dot:true}, callback)
    }
19395
function guidWithCheck(callback) {
        const id = guid();
        context.getObject(id, function (err, value) {
          if (err) {
            callback(err);
            return;
          }

          // If this id is unused, use it, otherwise find another
          if (!value) {
            callback(null, id);
          } else {
            guidWithCheck(callback);
          }
        });
      }
1103186
@SuppressWarnings("unchecked")
  public <C extends CDACallback<T>> C one(String id, C callback) {
    return (C) Callbacks.subscribeAsync(baseQuery().one(id), callback, client);
  }
597762
def add_reader(self, fd, callback):
        "  "
        fd = fd_to_int(fd)
        self._read_fds[fd] = callback
        self.selector.register(fd)
782144
function del(id, callback) {

    callback = callback || emptyFn

    if (typeof callback !== 'function') {
      throw new TypeError('callback must be a function or empty')
    }

    if (!idIndexData[id]) {
      return callback(new Error('No object found with \'' + options.idProperty +
          '\' = \'' + id + '\''))
    }

    self.emit('delete', id)

    delete idIndexData[id]

    // Work around for dynamic property
    var find = {}
    find[options.idProperty] = id

    data.splice(_.findIndex(data, find), 1)

    saveFile('afterDelete', id, callback)
  }
1114782
function read(src, basedir, callback){
  var page = new Page(src, basedir)

  page.read(callback)
}
1242554
public <P extends ParaObject> P read(String type, String id) {
		if (StringUtils.isBlank(type) || StringUtils.isBlank(id)) {
			return null;
		}

		return getEntity(invokeGet(type.concat("/").concat(id), null), ParaObjectUtils.toClass(type));
	}
31283
public function setId($id)
    {
        if (isset($this->id)) {
            throw new InvalidCallException('Setting read-only property: ' . get_class($this) . '::id');
        }
        $this->id = $id;
    }
1293640
function read(callback) {
        let raw = fs.readFileSync(thing.path).toString()
        //let json = thing.path.split('.').reverse()[0] === 'json'
        // TODO add support for role.yaml
        let policies = JSON.parse(raw).policies
        callback(null, policies || [])
      }
1161701
public void loadContentDefinition(final String entityId, final Command callback) {

        AsyncCallback<CmsContentDefinition> asyncCallback = new AsyncCallback<CmsContentDefinition>() {

            public void onFailure(Throwable caught) {

                onRpcError(caught);
            }

            public void onSuccess(CmsContentDefinition result) {

                registerContentDefinition(result);
                callback.execute();
            }
        };
        getService().loadContentDefinition(entityId, asyncCallback);
    }
165498
function readStream (stream, encoding, length, limit, callback) {
  var complete = false
  var sync = true

  // check the length and limit options.
  // note: we intentionally leave the stream paused,
  // so users should handle the stream themselves.
  if (limit !== null && length !== null && length > limit) {
    return done(createError(413, 'request entity too large', {
      expected: length,
      length: length,
      limit: limit,
      type: 'entity.too.large'
    }))
  }

  // streams1: assert request encoding is buffer.
  // streams2+: assert the stream encoding is buffer.
  //   stream._decoder: streams1
  //   state.encoding: streams2
  //   state.decoder: streams2, specifically < 0.10.6
  var state = stream._readableState
  if (stream._decoder || (state && (state.encoding || state.decoder))) {
    // developer error
    return done(createError(500, 'stream encoding should not be set', {
      type: 'stream.encoding.set'
    }))
  }

  var received = 0
  var decoder

  try {
    decoder = getDecoder(encoding)
  } catch (err) {
    return done(err)
  }

  var buffer = decoder
    ? ''
    : []

  // attach listeners
  stream.on('aborted', onAborted)
  stream.on('close', cleanup)
  stream.on('data', onData)
  stream.on('end', onEnd)
  stream.on('error', onEnd)

  // mark sync section complete
  sync = false

  function done () {
    var args = new Array(arguments.length)

    // copy arguments
    for (var i = 0; i < args.length; i++) {
      args[i] = arguments[i]
    }

    // mark complete
    complete = true

    if (sync) {
      process.nextTick(invokeCallback)
    } else {
      invokeCallback()
    }

    function invokeCallback () {
      cleanup()

      if (args[0]) {
        // halt the stream on error
        halt(stream)
      }

      callback.apply(null, args)
    }
  }

  function onAborted () {
    if (complete) return

    done(createError(400, 'request aborted', {
      code: 'ECONNABORTED',
      expected: length,
      length: length,
      received: received,
      type: 'request.aborted'
    }))
  }

  function onData (chunk) {
    if (complete) return

    received += chunk.length

    if (limit !== null && received > limit) {
      done(createError(413, 'request entity too large', {
        limit: limit,
        received: received,
        type: 'entity.too.large'
      }))
    } else if (decoder) {
      buffer += decoder.write(chunk)
    } else {
      buffer.push(chunk)
    }
  }

  function onEnd (err) {
    if (complete) return
    if (err) return done(err)

    if (length !== null && received !== length) {
      done(createError(400, 'request size did not match content length', {
        expected: length,
        length: length,
        received: received,
        type: 'request.size.invalid'
      }))
    } else {
      var string = decoder
        ? buffer + (decoder.end() || '')
        : Buffer.concat(buffer)
      done(null, string)
    }
  }

  function cleanup () {
    buffer = null

    stream.removeListener('aborted', onAborted)
    stream.removeListener('data', onData)
    stream.removeListener('end', onEnd)
    stream.removeListener('error', onEnd)
    stream.removeListener('close', cleanup)
  }
}
131978
public function read($id)
    {
        if (!$data = $this->getCache()->load($this->normalizeId($id))) {
            return null;
        }

        return $data;
    }
317233
public void readLed(Callback<LedColor> callback) {
        addCallback(BeanMessageID.CC_LED_READ_ALL, callback);
        sendMessageWithoutPayload(BeanMessageID.CC_LED_READ_ALL);
    }
650437
async def read(cls, id: int):
        """"""
        data = await cls._handler.read(id=id)
        return cls(data)
747815
function find(id, callback) {
        var Model, request;

        Model = this;
        request = {
            action : 'findOne',
            model : Model,
            params : {
                id : id
            }
        };
        this.storage.findOne(request, function findOneCallback(data) {
            if (callback) {
                callback(data);
            }
        });
        return this;
    }
144248
function(id, callback) {
    var self = this;
    
    if (typeof id == 'number' || typeof id == 'string' || id instanceof Array || id instanceof ObjectID) {

      this.driver.deleteById({
        collection: this.context,
        _id: id
      }, function(err) {
        callback.call(self, err);
      });
      
    } else if (id && typeof id == 'object') {
      
      var o = id;
      
      this.driver.deleteWhere({
        collection: this.context,
        condition: o
      }, function(err) {
        callback.call(self, err);
      });
      
    } else {
      callback.call(self, new Error(util.format("%s: Wrong value for `id` parameter", this.className)));
    }
  }