示例#1
0
 public function setUp()
 {
     parent::setUp();
     $this->hasOne('Wordlist', array('local' => 'wordlist_id', 'foreign' => 'id'));
 }
示例#2
0
 /**
  * An example of how to populate a new sfWordnikWord object using it's populate method.
  *
  * @param sfWebRequest $request
  */
 public function executeNewWord(sfWebRequest $request)
 {
     $word = new sfWordnikWord();
     // NOTE -- changed this from `getGetParameter` to `getParameter.` (andyinabox - 2010-05-20)
     $word->populate(Wordnik::getWordObject($request->getParameter("word")));
     //  	$word->name = $request->getGetParameter("word");
     //  	$word->Definitions[]->text = "To see if something works.";
     //  	$word->Examples[]->text = "Let's test this motor, see if it works.'";
     //  	$word->RelatedWords[]->text = "try";
     $word->save();
     $this->success = "Awesome.";
 }