cristalmolix Posted February 28, 2010 Share Posted February 28, 2010 this works //class PageTable extends Doctrine_Table $page = $this->createQuery() ->select('id, body') ->from('page') ->where("id = '".$page_id."'") ->limit(1) ->fetchArray(array(), Doctrine::HYDRATE_NONE); this works $page = Doctrine::getTable(self::pageTable)->findOneById( $id ) ; // NOTE you can perform updates to $page in many ways now none of them work except the below wich requires a validated form $page->merge($form->getValues()); this dosent work //class PageTable extends Doctrine_Table $page = $this->createQuery() ->update('cms_page_part') ->set('content_html', $page_record['body']) ->set('content', $page_record['body']) ->where("id = '".$page_id."'") ->fetchArray(array(), Doctrine::HYDRATE_NONE); basically there is more than one way of doing updates and getting the object, i can get the object but cant do updates in any of the ways described, the original developer of the app uses merge but i cant seem to do it with an array it has to be one of his validated arrays that the only object child of docterine object it accepts. why cant i do straight up updates to objects i can retrieve. i know all about the model and how to implement them in docterine i can get the opbject inside the controler and perform it there or i can do it inside the table class still updates dont work any help otherwise im gona have to do str8 up sql Quote Link to comment https://forums.phpfreaks.com/topic/193706-cant-do-docterine-updates-but-can-do-selects-and-merge/ Share on other sites More sharing options...
cristalmolix Posted March 1, 2010 Author Share Posted March 1, 2010 i know i should use an array for the set but like i said i tried quite a few different ways to update this Quote Link to comment https://forums.phpfreaks.com/topic/193706-cant-do-docterine-updates-but-can-do-selects-and-merge/#findComment-1019650 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.