likely the last commit had a serious vulnerability. this is just a sync
Deploy vintagecoding.net / deploy (push) Canceled after 0s
Deploy vintagecoding.net / deploy (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
class SpaceMember
|
||||
{
|
||||
private int $id;
|
||||
private User $user;
|
||||
private Space $space;
|
||||
private int $role;
|
||||
private DateTime $addedAt;
|
||||
private bool $favorited;
|
||||
|
||||
public function __construct(int $id, User $user, Space $space, int $role, DateTime $addedAt, bool $favorited)
|
||||
{
|
||||
error_log('Instantiating a space member');
|
||||
if (!User::exists($user->getId()) || !Space::exists($space->getId()))
|
||||
return;
|
||||
|
||||
$this->user = $user;
|
||||
$this->space = $space;
|
||||
$this->role = $role;
|
||||
$this->addedAt = $addedAt;
|
||||
$this->favorited = $favorited;
|
||||
|
||||
if ($id < 0) {
|
||||
$this->id = $id * -1;
|
||||
|
||||
$stmt = 'INSERT INTO spaceMembers (id, user, space, role, favorited) VALUES (?, ?, ?, ?, ?)';
|
||||
exec_stmt($stmt, 'iiiii', $this->id, $user->getId(), $space->getId(), $role, $favorited);
|
||||
}
|
||||
}
|
||||
|
||||
public function getUser()
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function getSpace()
|
||||
{
|
||||
return $this->space;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user