public static function entityDefinition() { /** @var static $columns */ $columns = new \stdClass(); $columns->diafilmId = Diafilm::entityDefinition()->id; $columns->imageId = Image::entityDefinition()->id; $columns->position = new Column(Column::INTEGER); $def = new Table($columns); $def->setPrimaryKey($columns->diafilmId, $columns->imageId); return $def; }
public function getCoverImage() { return Image::find($this->coverImageId); }