src/CronHelper/Model/JobMapper.php
public function fetchById($id, array $options = array())
	{
		$select = $this->sql->select();
		$where = new Where();

		if (is_array($id)) {
			if (count($id) == 0) {
				return null;
			}
			$where->in('id', $id);
		} else {
			$where->equalTo('id', $id);
		}

		$select->where($where);

		$stmt = $this->sql->prepareStatementForSqlObject($select);
		$result = $stmt->execute();

		// Options: hydrate
		$hydrate = array_key_exists('hydrate', $options) ? (bool) $options['hydrate'] : true;

		if (is_array($id)) {
			if ($hydrate !== true) {
				return $result;
			}

			return $this->hydrateResult($result);
		}

		if ($result->count() == 0) {
			return null;
		}

		if ($hydrate !== true) {
			return $result->current();
		}

		$hydrator = new ClassMethods();
		$entity = new JobEntity();
		$hydrator->hydrate($result->current(), $entity);

		return $entity;
	}
public function fetchById($id, array $options = array())
	{
		$select = $this->sql->select();
		$where = new Where();

		if (is_array($id)) {
			if (count($id) == 0) {
				return null;
			}
			$where->in('id', $id);
		} else {
			$where->equalTo('id', $id);
		}

		$select->where($where);

		$stmt = $this->sql->prepareStatementForSqlObject($select);
		$result = $stmt->execute();

		// Options: hydrate
		$hydrate = array_key_exists('hydrate', $options) ? (bool) $options['hydrate'] : true;

		if (is_array($id)) {
			if ($hydrate !== true) {
				return $result;
			}

			return $this->hydrateResult($result);
		}

		if ($result->count() == 0) {
			return null;
		}

		if ($hydrate !== true) {
			return $result->current();
		}

		$hydrator = new ClassMethods();
		$entity = new JobEntity();
		$hydrator->hydrate($result->current(), $entity);

		return $entity;
	}
Find jobs(s) by its/their ID(s).

@param integer|array $id
@param array $options (Optional.)
@return Result|HydratingResultSet|JobEntity|null