public function find($pkId)
{
$dsId = $this->readSourceId;
$primaryKey = static::PRIMARY_KEY;
$conn = $this->getReadConnection();
if (!$this->_preparedFindStm) {
$this->_preparedFindStm = $conn->prepare(static::FIND_BY_PRIMARY_KEY_SQL);
}
$this->_preparedFindStm->execute([":{$primaryKey}" => $pkId]);
if (false === ($this->_data = $this->_preparedFindStm->fetch(PDO::FETCH_ASSOC))) {
return $this->reportError('Record not found', ['sql' => static::FIND_BY_PRIMARY_KEY_SQL]);
}
$this->_preparedFindStm->closeCursor();
return $this->reportSuccess('Data loaded', array('id' => isset($this->_data[$primaryKey]) ? $this->_data[$primaryKey] : null, 'sql' => static::FIND_BY_PRIMARY_KEY_SQL, 'type' => Result::TYPE_LOAD));
}