}
- function checkName($roo)
+ function checkName()
{
+ $company = DB_DataObject::factory('core_company');
+ $company->setFrom(array(
+ 'name' => $this->name
+ ));
+
+ if(!empty($this->id)){
+ $company->whereAdd("id != {$this->id}");
+ }
+ if(!$company->find(true)){
+ return true
+ }
+
+ return false;
}
}