Subscription.php 1.73 KB
<?php

namespace FootyRoom\Core\Subscription;

class Subscription
{
    /**
     * @var int
     */
    protected $id;

    /**
     * @var int
     */
    protected $userId;

    /**
     * @var int
     */
    protected $subjectId;

    /**
     * @var string
     */
    protected $subjectType;

    /**
     * Can be 'follow' or 'ignore'.
     *
     * @var string
     */
    protected $status;

    /**
     * Constructor.
     *
     * @param int $subjectId
     * @param string $subjectType
     * @param int $userId
     */
    public function __construct($subjectId, $subjectType, $userId)
    {
        $this->subjectId = $subjectId;
        $this->subjectType = $subjectType;
        $this->userId = $userId;
    }

    /**
     * Gets the value of id.
     *
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Gets the value of status.
     *
     * @return string
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Gets the value of subjectId.
     *
     * @return int
     */
    public function getSubjectId()
    {
        return $this->subjectId;
    }

    /**
     * Gets the value of subjectType.
     *
     * @return string
     */
    public function getSubjectType()
    {
        return $this->subjectType;
    }

    /**
     * Gets the value of userId.
     *
     * @return string
     */
    public function getUserId()
    {
        return $this->userId;
    }

    /**
     * Make this a 'follow' subscription.
     */
    public function follow()
    {
        $this->status = 'follow';
    }

    /**
     * Make this an 'ignore' subscription.
     */
    public function ignore()
    {
        $this->status = 'ignore';
    }
}