Craft\NeoService::_getBlockRecord PHP Method

_getBlockRecord() private method

If the block is just newly created, a fresh record will be returned.
private _getBlockRecord ( Neo_BlockModel $block ) : Neo_BlockRecord
$block Neo_BlockModel
return Neo_BlockRecord
    private function _getBlockRecord(Neo_BlockModel $block)
    {
        $blockId = $block->id;
        if ($blockId) {
            if (!isset($this->_blockRecordsById) || !array_key_exists($blockId, $this->_blockRecordsById)) {
                $this->_blockRecordsById[$blockId] = Neo_BlockRecord::model()->with('element')->findById($blockId);
                if (!$this->_blockRecordsById[$blockId]) {
                    throw new Exception(Craft::t('No block exists with the ID “{id}”.', ['id' => $blockId]));
                }
            }
            return $this->_blockRecordsById[$blockId];
        }
        return new Neo_BlockRecord();
    }