コード例 #1
0
ファイル: GetExhibitTest.php プロジェクト: saden1/Neatline
 /**
  * `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);
 }
コード例 #2
0
 /**
  * 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;
 }