$attribute * @param mixed $value */ public function set($attribute, $value = null): void; /** * Get an attribute value. * * @return mixed */ public function get(string $attribute); /** * Whether an attribute value is set. */ public function has(string $attribute): bool; /** * Clear an attribute value. */ public function clear(string $attribute): void; /** * Get an entity type. */ public function getEntityType(): string; /** * Get attribute list defined for an entity type. * * @return string[] */ public function getAttributeList(): array; /** * Get relation list defined for an entity type. * * @return string[] */ public function getRelationList(): array; /** * Whether an entity type has an attribute defined. */ public function hasAttribute(string $attribute): bool; /** * Whether an entity type has a relation defined. */ public function hasRelation(string $relation): bool; /** * Get an attribute type. */ public function getAttributeType(string $attribute): ?string; /** * Get a relation type. */ public function getRelationType(string $relation): ?string; /** * Whether an entity is new. */ public function isNew(): bool; /** * Set an entity as fetched. All current attribute values will be set as those that are fetched * from the database. */ public function setAsFetched(): void; /** * Whether is fetched from the database. */ public function isFetched(): bool; /** * Whether an attribute was changed (since syncing with the database). */ public function isAttributeChanged(string $name): bool; /** * Get a fetched value of a specific attribute. * * @return mixed */ public function getFetched(string $attribute); /** * Whether a fetched value is set for a specific attribute. */ public function hasFetched(string $attribute): bool; /** * Set a fetched value for a specific attribute. * * @param mixed $value */ public function setFetched(string $attribute, $value): void; /** * Get values. */ public function getValueMap(): stdClass; /** * Set as not new. Meaning the entity is fetched or already saved. */ public function setAsNotNew(): void; /** * Copy all current values to fetched values. All current attribute values will be set as those * that are fetched from DB. */ public function updateFetchedValues(): void; }