コード例 #1
0
 /**
  * Get the associated Author object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Author The associated Author object.
  * @throws     PropelException
  */
 public function getAuthor(PropelPDO $con = null)
 {
     if ($this->aAuthor === null && $this->author_id !== null) {
         $this->aAuthor = AuthorPeer::retrieveByPk($this->author_id);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aAuthor->addAuthorArticles($this);
         		 */
     }
     return $this->aAuthor;
 }
コード例 #2
0
 function runPKSearch($i)
 {
     $author = AuthorPeer::retrieveByPk($this->authors[array_rand($this->authors)], $this->con);
 }