/** * Set the field's name. * @param string $inName The field's name. * @return $this * @throws \Exception */ public function setName($inName) { $tokens = explode('.', $inName); if (count($tokens) != 2) { throw new \Exception("Invalid field name \"{$inName}\". Fields' names must follow the convention \"table.field\"."); } $this->__tableName = $tokens[0]; parent::setName($inName); $this->__table = Table::getByClassAndName(Table::getFullyQualifiedClassName(), $this->__tableName); if (false === $this->__table) { throw new \Exception("For field {$inName}: table {$this->__tableName} does not exist !"); } $this->addToRepository($inName); return $this; }