So, I'm wanting to make sitewide quests without having to add a billion columns to adopts_user. Soooo, I thought I'd create a new domain model and table to match. It isn't working out so well. Here's what I have.
adopts_sitequests
(I also don't know how to make it auto add a row when a new user joins...)
Spoiler: arloview.php
arlocontroller.php
Spoiler: model/domainmodel/sitequests.php
Any help is appreciated!!! I'm going to continue playing around with it, but hopefully one of you are more knowledgeable than I am.
adopts_sitequests
(I also don't know how to make it auto add a row when a new user joins...)
PHP:
<?php
namespace View\Main;
use Controller\Main;
use Model\DomainModel\Item;
use Model\DomainModel\Member;
use Model\DomainModel\OwnedItem;
use Resource\Core\Registry;
use Resource\Core\View;
use Resource\GUI\Document\Comment;
use Model\DomainModel\Sitequests;
use Model\DomainModel\User;
class ArloView extends View{
public function index(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle("Arlo's Tower");
//This doesn't matter because it still works.
}
public function quest(){
$mysidia = Registry::get("mysidia");
$document = $this->document;
$document->setTitle("Quest from Arlo!");
$user = $mysidia->user->getUsername();
$quester = $mysidia->sitequests->getQuesterName();
if($quester == $user){
$charquest = $quest->charquest;
$sitequestday = $quest->sitequestday;
$questnum = $quest->arlo;
}
}
}
arlocontroller.php
PHP:
<?php
namespace Model\DomainModel;
use Resource\Core\Model;
use Resource\Core\Registry;
use Resource\Exception\InvalidActionException;
use Resource\GUI\Component\Image;
use Resource\Utility\Date;
class Sitequests extends Model{
public $quester;
public $sitequestday;
public $charquest;
public $arlo;
public $ezra;
public $ursa;
public $callie;
public $sammy;
public $tom;
public $aiden;
public $gobgob;
public function getQuesterID(){
$quester = $this->getQuester("model");
return $quester ? $quester->getID() : 0;
}
public function getQuesterName(){
$quester = $this->getQuester("model");
return $quester ? $quester->getUsername() : "SYSTEM";
}
public function setQuester($quester){
$this->fromuser = ($quester instanceof Member) ? $quester->getID() : $quester;
}
public function getSitequestday(){
return $this->sitequestday;
}
public function getCharquest(){
return $this->charquest;
}
public function getArlo(){
return $this->arlo;
}
public function getEzra(){
return $this->ezra;
}
public function getUrsa(){
return $this->ursa;
}
public function getTom(){
return $this->tom;
}
public function getAiden(){
return $this->aiden;
}
public function getSammy(){
return $this->sammy;
}
public function getCallie(){
return $this->callie;
}
public function getGobgob(){
return $this->getGobgob;
}
}
Any help is appreciated!!! I'm going to continue playing around with it, but hopefully one of you are more knowledgeable than I am.
