protected function createDefaultEschool() { $eschool = new GcrEschool(); $eschool->setShortName($this->default_eschool_id); $eschool->setFullName($this->full_name); // Create new address and person objects for the eschool // but set the values equal to the institution $address = $this->getAddressObject()->copy(false); $address->save(); $eschool->setAddress($address->getId()); $person = $this->getPersonObject()->copy(false); $person->save(); $eschool->setContact1($person->getId()); $person2 = $this->getPerson2Object()->copy(false); $person2->save(); $eschool->setContact2($person2->getId()); // A copy of the logo image file will be made in GcrDatabaseAccessPostgres::createSchema // when the eschool schema is created. $eschool->setLogo($this->logo); $institution_type = $this->getAppType(); $eschool->setEschoolType($institution_type->getEschoolTypeId()); $eschool->setPasswordSalt(GcrEschoolTable::generateRandomString()); $eschool->setAdminPassword(GcrEschoolTable::generateAdminPassword()); $eschool->setEschoolCreator($this->id); $eschool->setCreationDate(time()); $eschool->setOrganizationId($this->id); $eschool->save(); $eschool->create(); }