コード例 #1
0
 private function _insertTags($book)
 {
     if ($book->Tags) {
         $this->_table = 'Tag';
         $tags = explode(',', $book->Tags);
         $tagids = array();
         foreach ($tags as $tag) {
             $res = current(parent::_retrieve('TagName', $tag));
             if ($res) {
                 $tagids[] = $res->TagId;
             } else {
                 parent::_create(array('TagName' => $tag));
                 $tagids[] = $this->lastInsertId();
             }
         }
         $book->Tags = implode(',', $tagids);
         $this->_table = 'Book';
     }
     return $book;
 }
コード例 #2
0
 /**
  * Deletes a user
  * @param <type> $value
  * @param <type> $field
  * @return <type>
  */
 public function delete($value, $field = 'UserId')
 {
     return parent::_delete($field, $value);
 }