acctman Posted April 17, 2011 Share Posted April 17, 2011 from what i understand from the coding... $form->getField('uri') is for the Sql table field (field uri) location and ->getValue() is the inputbox Value so ->setUri is grabbing the inputbox value and inserting it into Field 'uri' but what I need to do is combine getValue with the string/url profile.site.com/file?name= $new_uri ->setUri($form->getField('uri')->getValue()) ->setHost($form->getField('host')->getValue()) ->setUser($user->isAuthorized() ? $user->getId() : 0) ->save(); Quote Link to comment https://forums.phpfreaks.com/topic/233980-adding-to-an-array/ Share on other sites More sharing options...
maxudaskin Posted April 17, 2011 Share Posted April 17, 2011 You have to give us some code to work with. Giving us a class name does not help, unless we can actually see that class, or at least the docs for it. Quote Link to comment https://forums.phpfreaks.com/topic/233980-adding-to-an-array/#findComment-1202657 Share on other sites More sharing options...
acctman Posted April 17, 2011 Author Share Posted April 17, 2011 You have to give us some code to work with. Giving us a class name does not help, unless we can actually see that class, or at least the docs for it. this is the documentation I've been reading and work with. All data stored in Mokoala's CMS (each record) is handled through an instance of MK_Record. Let's assume there's a table with two fields; 'full_name' and 'married'. Accessing row data is performed as follows; the field 'full_name' would be accessed by calling $record->getFullName() or by calling $record->getMetaValue('full_name'). The 'get' method prefix simply returns the data stored under that field, for that record. If you want to check if a value is set, for instance on the field 'married', you can use $record->isMarried() $record->isMetaData('married'). The 'is' method prefix casts the returned data for that record as a (boolean) value. For instance if 'married' was '0' false would be returned. You can also use 'is' methods to set data. If you were to call $record->isMarried(true) or $record->isMetaData('married', true) this data would be set to 1/true or 0/false depending on the field type. If you want to change the value of the 'full_name' field then you would use $record->setFullName('Matt Lowden') or $record->setMetaValue('full_name', 'Matt Lowden'). In order to save these changes to the database you would use $record->save(). The save and 'set' methods return an instance of $record so they can be strung together, as shown below. $user_module = MK_RecordModuleManager::getFromType('user'); $user = MK_RecordManager::getFromId($user_module>getId(), 1); // `full_name` = 'Matt Lowden', `married` = '0' $user ->setFullName('Matthew Lowden') ->isMarried(true) ->save(); print $user->getFullName(); // Would print 'Matthew Lowden' Quote Link to comment https://forums.phpfreaks.com/topic/233980-adding-to-an-array/#findComment-1202673 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.