public function getIsAutomatedByDefault() { $attr = AgentAttribute::findOne(['name' => (string) $this->name]); if ($attr && $attr->is_automated) { return true; } return false; }
public function estimateAutomatedAgent() { if ($this->hasErrors()) { return; } if ($this->automated === 'yes' || $this->automated === 'no') { return; } $this->automated = 'no'; if ($this->agent != '') { $attr = AgentAttribute::findOne(['name' => (string) $this->agent]); if ($attr && $attr->is_automated) { $this->automated = 'yes'; } } }