Craft\NeoService::getBlockTypeById PHP Method

getBlockTypeById() public method

Finds a block type by it's ID.
public getBlockTypeById ( $blockTypeId ) : Neo_BlockTypeModel
$blockTypeId
return Neo_BlockTypeModel
    public function getBlockTypeById($blockTypeId)
    {
        if (!isset($this->_blockTypesById) || !array_key_exists($blockTypeId, $this->_blockTypesById)) {
            $result = $this->_createBlockTypeQuery()->where('id = :id', [':id' => $blockTypeId])->queryRow();
            if ($result) {
                $blockType = new Neo_BlockTypeModel($result);
            } else {
                $blockType = null;
            }
            $this->_blockTypesById[$blockTypeId] = $blockType;
        }
        return $this->_blockTypesById[$blockTypeId];
    }