Commit cd886cf3 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

[TASK] Changes to PSR-2

parent 3ee40b8c
...@@ -14,71 +14,76 @@ ...@@ -14,71 +14,76 @@
/** /**
* Class Tx_T3oMembership_Controller_MemberController * Class Tx_T3oMembership_Controller_MemberController
*
* @author Thomas Löffler <thomas.loeffler@typo3.org> * @author Thomas Löffler <thomas.loeffler@typo3.org>
*/ */
class Tx_T3oMembership_Controller_MemberController extends Tx_Extbase_MVC_Controller_ActionController { class Tx_T3oMembership_Controller_MemberController extends Tx_Extbase_MVC_Controller_ActionController
{
/** /**
* memberRepository * memberRepository
* *
* @var Tx_T3oMembership_Domain_Repository_MemberRepository * @var Tx_T3oMembership_Domain_Repository_MemberRepository
*/ */
protected $memberRepository; protected $memberRepository;
/** /**
* membershipRepository * membershipRepository
* *
* @var Tx_T3oMembership_Domain_Repository_MembershipRepository * @var Tx_T3oMembership_Domain_Repository_MembershipRepository
*/ */
protected $membershipRepository; protected $membershipRepository;
/** /**
* injectMemberRepository * injectMemberRepository
* *
* @param Tx_T3oMembership_Domain_Repository_MemberRepository $memberRepository * @param Tx_T3oMembership_Domain_Repository_MemberRepository $memberRepository
* @return void * @return void
*/ */
public function injectMemberRepository(Tx_T3oMembership_Domain_Repository_MemberRepository $memberRepository) { public function injectMemberRepository(Tx_T3oMembership_Domain_Repository_MemberRepository $memberRepository)
$this->memberRepository = $memberRepository; {
} $this->memberRepository = $memberRepository;
}
/** /**
* injectMembershipRepository * injectMembershipRepository
* *
* @param Tx_T3oMembership_Domain_Repository_MembershipRepository $membershipRepository * @param Tx_T3oMembership_Domain_Repository_MembershipRepository $membershipRepository
* @return void * @return void
*/ */
public function injectMembershipRepository(Tx_T3oMembership_Domain_Repository_MembershipRepository $membershipRepository) { public function injectMembershipRepository(Tx_T3oMembership_Domain_Repository_MembershipRepository $membershipRepository)
$this->membershipRepository = $membershipRepository; {
} $this->membershipRepository = $membershipRepository;
}
/** /**
* action list * action list
* *
* @return void * @return void
*/ */
public function listAction() { public function listAction()
$filterMembership = 0; {
$filterString = ''; $filterMembership = 0;
$filterString = '';
if ($this->request->hasArgument('filter') && $this->request->getArgument('filter')) { if ($this->request->hasArgument('filter') && $this->request->getArgument('filter')) {
$filterString = htmlspecialchars($this->request->getArgument('filter')); $filterString = htmlspecialchars($this->request->getArgument('filter'));
$this->view->assign('filter', $filterString); $this->view->assign('filter', $filterString);
} }
if ($this->request->hasArgument('membership') && $this->request->getArgument('membership')) { if ($this->request->hasArgument('membership') && $this->request->getArgument('membership')) {
$filterMembership = (int) $this->request->getArgument('membership'); $filterMembership = (int)$this->request->getArgument('membership');
$this->view->assign('membership', $filterMembership); $this->view->assign('membership', $filterMembership);
} }
if ($filterString || $filterMembership) { if ($filterString || $filterMembership) {
$members = $this->memberRepository->findByStringAndMembership($filterString, $filterMembership); $members = $this->memberRepository->findByStringAndMembership($filterString, $filterMembership);
} else { } else {
$members = $this->memberRepository->findAll(); $members = $this->memberRepository->findAll();
} }
$memberships = $this->membershipRepository->findAll(); $memberships = $this->membershipRepository->findAll();
$this->view->assign('memberships', $memberships); $this->view->assign('memberships', $memberships);
$this->view->assign('members', $members); $this->view->assign('members', $members);
} }
} }
\ No newline at end of file
...@@ -14,340 +14,366 @@ ...@@ -14,340 +14,366 @@
/** /**
* Class Tx_T3oMembership_Domain_Model_Member * Class Tx_T3oMembership_Domain_Model_Member
*
* @author Thomas Löffler <thomas.loeffler@typo3.org> * @author Thomas Löffler <thomas.loeffler@typo3.org>
*/ */
class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_AbstractEntity { class Tx_T3oMembership_Domain_Model_Member extends Tx_Extbase_DomainObject_AbstractEntity
{
/**
* Member name /**
* * Member name
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $name; */
protected $name;
/**
* externalId /**
* * externalId
* @var integer *
* @validate NotEmpty * @var integer
*/ * @validate NotEmpty
protected $externalId; */
protected $externalId;
/**
* endDate /**
* * endDate
* @var DateTime *
* @validate NotEmpty * @var DateTime
*/ * @validate NotEmpty
protected $endDate; */
protected $endDate;
/**
* address /**
* * address
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $address; */
protected $address;
/**
* zip /**
* * zip
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $zip; */
protected $zip;
/**
* city /**
* * city
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $city; */
protected $city;
/**
* country /**
* * country
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $country; */
protected $country;
/**
* email /**
* * email
* @var string *
* @validate NotEmpty * @var string
*/ * @validate NotEmpty
protected $email; */
protected $email;
/**
* firstname /**
* * firstname
* @var string *
*/ * @var string
protected $firstname; */
protected $firstname;
/**
* url /**
* * url
* @var string *
*/ * @var string
protected $url; */
protected $url;
/**
* lastname /**
* * lastname
* @var string *
*/ * @var string
protected $lastname; */
protected $lastname;
/**
* @var string /**
*/ * @var string
protected $invoiceEmail; */
protected $invoiceEmail;
/**
* membership /**
* * membership
* @var Tx_T3oMembership_Domain_Model_Membership *
*/ * @var Tx_T3oMembership_Domain_Model_Membership
protected $membership; */
protected $membership;
/**
* Returns the name /**
* * Returns the name
* @return string $name *
*/ * @return string $name
public function getName() { */
return $this->name; public function getName()
} {
return $this->name;
/** }
* Sets the name
* /**
* @param string $name * Sets the name
* @return void *
*/ * @param string $name
public function setName($name) { * @return void
$this->name = $name; */
} public function setName($name)
{
$this->name = $name;
/** }
* @return string
*/
public function getFirstname() /**
{ * @return string
return $this->firstname; */
} public function getFirstname()
{
/** return $this->firstname;
* @param string $firstname }
*/
public function setFirstname($firstname) /**
{ * @param string $firstname
$this->firstname = $firstname; */
} public function setFirstname($firstname)
{
/** $this->firstname = $firstname;
* @return string }
*/
public function getLastname() { /**
return $this->lastname; * @return string
} */
public function getLastname()
/** {
* @param string $lastname return $this->lastname;
*/ }
public function setLastname($lastname) {
$this->lastname = $lastname; /**
} * @param string $lastname
*/
/** public function setLastname($lastname)
* Returns the externalId {
* $this->lastname = $lastname;
* @return integer $externalId }
*/
public function getExternalId() { /**
return $this->externalId; * Returns the externalId
} *
* @return integer $externalId
/** */
* Sets the externalId public function getExternalId()
* {
* @param integer $externalId return $this->externalId;
* @return void }
*/
public function setExternalId($externalId) { /**
$this->externalId = $externalId; * Sets the externalId
} *
* @param integer $externalId
/** * @return void
* Returns the endDate */
* public function setExternalId($externalId)
* @return DateTime $endDate {
*/ $this->externalId = $externalId;
public function getEndDate() { }
return $this->endDate;
} /**
* Returns the endDate
/** *
* Sets the endDate * @return DateTime $endDate
* */
* @param DateTime $endDate public function getEndDate()
* @return void {
*/ return $this->endDate;
public function setEndDate($endDate) { }
$this->endDate = $endDate;
} /**
* Sets the endDate
/** *
* Returns the address * @param DateTime $endDate
* * @return void
* @return string $address */
*/ public function setEndDate($endDate)
public function getAddress() { {
return $this->address; $this->endDate = $endDate;
} }
/** /**
* Sets the address * Returns the address
* *
* @param string $address * @return string $address
* @return void */
*/ public function getAddress()
public function setAddress($address) { {
$this->address = $address; return $this->address;
} }
/** /**
* Returns the zip * Sets the address
* *
* @return string $zip * @param string $address
*/ * @return void
public function getZip() { */
return $this->zip; public function setAddress($address)
} {
$this->address = $address;
/** }
* Sets the zip
* /**
* @param string $zip * Returns the zip
* @return void *
*/ * @return string $zip
public function setZip($zip) { */
$this->zip = $zip; public function getZip()
} {
return $this->zip;
/** }
* Returns the city
* /**
* @return string $city * Sets the zip
*/ *
public function getCity() { * @param string $zip
return $this->city; * @return void
} */
public function setZip($zip)
/** {
* Sets the city $this->zip = $zip;
* }
* @param string $city
* @return void /**
*/ * Returns the city
public function setCity($city) { *
$this->city = $city; * @return string $city
} */
public function getCity()
/** {
* Returns the country return $this->city;
* }
* @return string $country
*/ /**
public function getCountry() { * Sets the city
return $this->country; *
} * @param string $city
* @return void
/** */
* Sets the country public function setCity($city)
* {
* @param string $country $this->city = $city;
* @return void }
*/
public function setCountry($country) { /**
$this->country = $country; * Returns the country
} *
* @return string $country
/** */
* Returns the email public function getCountry()
* {
* @return string $email return $this->country;
*/ }