public function getTableName() { if (is_null($this->table)) { $tmp = get_class($this); $this->table = strtolower(substr($tmp, strrpos($tmp, '\\') + 1, -5)); } return $this->table; }