Skip to content

Commit

Permalink
Refactoring : renommer EventKindController en AdminEventKindController (
Browse files Browse the repository at this point in the history
elefan-grenoble#962)

* Rename EventKindController to AdminEventKindController. Cleanup

* Other cleanup
  • Loading branch information
raphodn authored and OursDesCavernes committed Jan 20, 2024
1 parent f78f6c4 commit e78dce8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@


/**
* EventKind controller.
* AdminEventKind controller
*
* @Route("admin/event/kinds")
*/
class EventKindController extends Controller
class AdminEventKindController extends Controller
{
/**
* Lists all event kinds
Expand Down
3 changes: 3 additions & 0 deletions src/AppBundle/Entity/Commission.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,22 @@ class Commission

/**
* Many Commissions have Many Beneficiaries.
*
* @ORM\ManyToMany(targetEntity="Beneficiary", mappedBy="commissions")
*/
private $beneficiaries;

/**
* Many Commissions have Many Tasks.
*
* @ORM\ManyToMany(targetEntity="Task", mappedBy="commissions")
* @OrderBy({"closed" = "ASC","dueDate" = "ASC"})
*/
private $tasks;

/**
* One Commission has Many Owners (Beneficiary).
*
* @ORM\OneToMany(targetEntity="Beneficiary", mappedBy="own",cascade={"persist"})
*/
private $owners;
Expand Down
4 changes: 2 additions & 2 deletions src/AppBundle/Entity/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ class Event
private $createdBy;

/**
* @ORM\Column(type="datetime")
*
* @var \DateTime
*
* @ORM\Column(type="datetime")
*/
private $updatedAt;

Expand Down
12 changes: 5 additions & 7 deletions src/AppBundle/Entity/EventKind.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ class EventKind
private $createdAt;

/**
* Define toString.
*
* @return string
*/
public function __toString()
Expand All @@ -62,7 +60,7 @@ public function setCreatedAtValue()
}

/**
* Get id.
* Get id
*
* @return int
*/
Expand All @@ -72,7 +70,7 @@ public function getId()
}

/**
* Set name.
* Set name
*
* @param string $name
*
Expand All @@ -86,7 +84,7 @@ public function setName($name)
}

/**
* Get name.
* Get name
*
* @return string
*/
Expand All @@ -96,7 +94,7 @@ public function getName()
}

/**
* Get events.
* Get events
*
* @return \Doctrine\Common\Collections\Collection
*/
Expand All @@ -106,7 +104,7 @@ public function getEvents()
}

/**
* Get createdAt.
* Get createdAt
*
* @return \DateTime
*/
Expand Down
6 changes: 4 additions & 2 deletions src/AppBundle/Entity/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Membership
protected $id;

/**
* @ORM\Column(type="bigint")
* @Assert\NotBlank(message="Merci d'entrer votre numéro d'adhérent")
* @ORM\Column(type="bigint")
*/
protected $member_number;

Expand Down Expand Up @@ -83,10 +83,12 @@ class Membership

/**
* @var Beneficiary
*
* One Membership has One Main Beneficiary.
*
* @Assert\Valid
* @ORM\OneToOne(targetEntity="Beneficiary",cascade={"persist", "remove"})
* @ORM\JoinColumn(name="main_beneficiary_id", referencedColumnName="id", onDelete="SET NULL")
* @Assert\Valid
*/
private $mainBeneficiary;

Expand Down
2 changes: 1 addition & 1 deletion src/AppBundle/Entity/MembershipShiftExemption.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ class MembershipShiftExemption

/**
* @Assert\Date
* @Assert\GreaterThan(propertyPath="start")
*
* @ORM\Column(name="end", type="date")
* @Assert\GreaterThan(propertyPath="start")
*/
private $end;

Expand Down
2 changes: 2 additions & 0 deletions src/AppBundle/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ class User extends BaseUser

/**
* Beneficiary's user.
*
* @Assert\Valid()
* @ORM\OneToOne(targetEntity="Beneficiary", mappedBy="user", fetch="EAGER")
*/
private $beneficiary;

/**
* Many Users have Many clients.
*
* @ORM\ManyToMany(targetEntity="Client", inversedBy="users")
* @ORM\JoinTable(name="users_clients")
*/
Expand Down

0 comments on commit e78dce8

Please sign in to comment.