firefly-iii/app/Services/Spectre/Object/Customer.php

112 lines
2.4 KiB
PHP
Raw Normal View History

<?php
/**
* Customer.php
* Copyright (c) 2019 thegrumpydictator@gmail.com
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Services\Spectre\Object;
/**
* Class Customer
2018-07-27 23:27:30 -05:00
*
* @codeCoverageIgnore
* @SuppressWarnings(PHPMD.ShortVariable)
*/
class Customer extends SpectreObject
{
/** @var int */
private $id;
/** @var string */
private $identifier;
/** @var string */
private $secret;
2017-12-27 10:22:44 -06:00
/**
* Customer constructor.
*
* @param array $data
*/
public function __construct(array $data)
{
2018-04-02 07:50:17 -05:00
$this->id = (int)$data['id'];
2017-12-27 10:22:44 -06:00
$this->identifier = $data['identifier'];
$this->secret = $data['secret'];
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id): void
{
$this->id = $id;
}
/**
* @return string
*/
public function getIdentifier(): string
{
return $this->identifier;
}
/**
* @param string $identifier
*/
public function setIdentifier(string $identifier): void
{
$this->identifier = $identifier;
}
/**
* @return string
*/
public function getSecret(): string
{
return $this->secret;
}
/**
* @param string $secret
*/
public function setSecret(string $secret): void
{
$this->secret = $secret;
}
2017-12-28 11:38:59 -06:00
/**
* @return array
*/
public function toArray(): array
{
return [
'id' => $this->id,
'identifier' => $this->identifier,
'secret' => $this->secret,
];
}
2017-12-22 11:32:43 -06:00
}