for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\XApi\Model;
/**
* The Actor of a {@link Statement}.
* @author Christian Flothmann <[email protected]>
abstract class Actor extends StatementObject
{
private $iri;
private $name;
public function __construct(InverseFunctionalIdentifier $iri = null, string $name = null)
$this->iri = $iri;
$this->name = $name;
}
* Returns the Actor's {@link InverseFunctionalIdentifier inverse functional identifier}.
public function getInverseFunctionalIdentifier(): ?InverseFunctionalIdentifier
return $this->iri;
* Returns the name of the {@link Agent} or {@link Group}.
public function getName(): ?string
return $this->name;
* Checks if another actor is equal.
* Two actors are equal if and only if all of their properties are equal.
public function equals(StatementObject $actor): bool
if (!parent::equals($actor)) {
return false;
if (!$actor instanceof Actor) {
if ($this->name !== $actor->name) {
if (null !== $this->iri xor null !== $actor->iri) {
if (null !== $this->iri && null !== $actor->iri && !$this->iri->equals($actor->iri)) {
return true;