<?php namespace FaZeBook\Data; use R; use RedBeanPHP\OODBBean; abstract class DataObject { /** * DBO = DataBaseObject. This is the raw bean that is persisted by the underlying ORM. */ public $dbo; function __construct($dbo) { $this->dbo = $dbo; } public function getId(): int { return $this->dbo->id; } protected function update() { R::store($this->dbo); } }