Small changes in the code to make something run again...

This commit is contained in:
Christian Wolf 2019-05-26 16:15:20 +02:00
parent 92481a62ac
commit 5a359ad97a
6 changed files with 36 additions and 29 deletions

View File

@ -8,4 +8,5 @@
</buildpathentry>
<buildpathentry external="true" kind="lib" path="/srv/slt-dev"/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
<buildpathentry external="true" kind="lib" path="/srv/http/slt"/>
</buildpath>

View File

@ -1,2 +1,2 @@
eclipse.preferences.version=1
include_path=1;/srv/slt-dev
include_path=1;/srv/slt-dev\u00051;/srv/http/slt

View File

@ -77,7 +77,7 @@ abstract class AbstractCommonClubsModelFactory
}
private $joins = null;
public function getAttributes($force = False)
public function getJoins($force = False)
{
if($this->joins === null || $force)
$this->joins = $this->fetchJoins();

View File

@ -15,17 +15,22 @@ class ClubsViewClub extends AbstractClubsViewSingle
$this->prepareDisplay();
$this->users = ClubsUser::loadUsers();
$userFactory = new CommonClubsModelFactoryUser();
$this->users = $userFactory->loadElements();
if(! $this->isNew)
if($this->isNew)
{
$offers = ClubsOffer::loadOffers();
$currentOffers = $this->object->getOffers();
$this->offers = array_map(function($offer) use ($currentOffers){
$mark = False;
return array('offer'=>$offer, 'mark'=>$mark);
}, $offers);
}
else
{
// $offers = ClubsOffer::loadOffers();
// $currentOffers = $this->object->getOffers();
// $this->offers = array_map(function($offer) use ($currentOffers){
// $mark = False;
// return array('offer'=>$offer, 'mark'=>$mark);
// }, $offers);
}
parent::display($tpl);

View File

@ -12,7 +12,8 @@ class ClubsViewClubs extends HtmlView
function display($tpl = null)
{
// $this->offers = ClubsOffer::loadOffers();
$this->clubs = ClubsClub::loadClubs();
$factory = new CommonClubsModelFactoryClub();
$this->clubs = $factory->loadElements();
ToolbarHelper::title('Club-Management - Clubs');
parent::display($tpl);

View File

@ -21,27 +21,27 @@ class ClubsViewTest extends HtmlView
$this->club = $this->clubs[0];
$c = $factory->loadById(1);
$p = $c->getPresident();
$id = $p->getId();
// $c = $factory->loadById(1);
// $p = $c->getPresident();
// $id = $p->getId();
$places = $c->getPlaces();
// $places[0]->setName("abc");
// $places[0]->save();
// $places = $c->getPlaces();
// // $places[0]->setName("abc");
// // $places[0]->save();
$pfactory = new CommonClubsModelFactoryPlace();
$np = $pfactory->createNew();
$np->setName('MyName');
$np->setClub($c);
// $np->save();
$np->getId();
// $pfactory = new CommonClubsModelFactoryPlace();
// $np = $pfactory->createNew();
// $np->setName('MyName');
// $np->setClub($c);
// // $np->save();
// $np->getId();
$np = $c->getPlaces()[2];
$np->getName();
// $np->setName('foo2 with new Name');
// $np->save();
// $np->delete();
$this->log = $np;
// $np = $c->getPlaces()[2];
// $np->getName();
// // $np->setName('foo2 with new Name');
// // $np->save();
// // $np->delete();
// $this->log = $np;
parent::display($tpl);
}