/** * Copies all objects (and, optionally, data) from this tenant to the specified tenant. * @param Tenant $tenant The tenant to which to copy the data. * @param boolean $includeData True if data (tenant property values and object instances) should be copied; false otherwise. */ public function CopyTo(Tenant $tenant, $includeData = true) { $properties = $this->GetProperties(); foreach ($properties as $property) { $tenant->CreateProperty($property); $tenant->SetPropertyValue($property, $this->GetPropertyValue($property)); } $objects = $this->GetObjects(); foreach ($objects as $object) { $instances = null; if ($includeData) { $instances = $object->GetInstances(); } $tenant->CreateObject($object->Name, $object->GetTitles(), $object->GetDescriptions(), $object->GetProperties(), $object->ParentObject, $instances); } }