/** * `getExhibit` should return the parent exhibit. */ public function testGetExhibit() { $exhibit = $this->_exhibit(); $record = new NeatlineRecord($exhibit); $retrieved = $record->getExhibit(); $this->assertEquals($exhibit->id, $retrieved->id); }
/** * Does the user own the record? * * @param User $user The user. * @param NeatlineRecord $record The record. * @return boolean */ private function _userOwnsRecord($user, $record) { $ownsRecord = $record->isOwnedBy($user); $ownsExhibit = $record->getExhibit()->isOwnedBy($user); return $ownsRecord || $ownsExhibit; }