getProperties(); foreach ($properties as $property) { if (in_array($property->name, self::object_excluded_properties)) { continue; } yield $property->name; } } /** * Reconstruct from a object, such as one found in Proposal. * Note that the fromProposal() method should be used when the * proposal is available, as it populates additional fields. * * @param \stdClass $changes * @return Changeset */ public static function fromObject($changes) { $changeset = new Changeset(); foreach ($changeset->walkProps() as $prop) { if (isset($changes->$prop)) { $changeset->$prop = $changes->$prop; } } return $changeset; } /** * Serialize to an object format that may be stored in a Proposal. * * @return \stdClass */ public function toObject() { $object = new \stdClass(); foreach ($this->walkProps() as $prop) { $object->$prop = array_values($this->$prop); } return $object; } public function hasAnyChanges() { foreach ($this->walkProps() as $prop) { if (!empty($this->$prop)) { return true; } } return false; } }