My database has some unusual naming conventions ( not my choice ).
And I can’t seem to get
hasOne reference to work ( haven’t even tried hasMany )
$urlsSearchTerms = new \atk4\data\Model($this->db, ['table'=>'UrlsSearchTerms','id_field'=>'Index','title_field'=>'title']); $userUrls = new \atk4\data\Model($this->db, ['table'=>'UsersUrls','id_field'=>'Index','title_field'=>'Url']); $urlsSearchTerms ->hasOne('UrlIndex',$userUrls) ->addFields(['Url']) // ->addTitle() ; $urlsSearchTerms->setLimit(5); var_dump($urlsSearchTerms->export());
If I run it as is I get
atk4\core\Exception: Child element not found.
If I switch
addTitle I get
atk4\core\Exception: Element with requested name already exists
What am I doing wrong here? Been breaking my head on this for a while now.