<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/mongodb.bson.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'class.mongodb-bson-serializable.php',
    1 => 'MongoDB\\BSON\\Serializable',
    2 => 'The MongoDB\\BSON\\Serializable interface',
  ),
  'up' => 
  array (
    0 => 'mongodb.bson.php',
    1 => 'MongoDB\\BSON',
  ),
  'prev' => 
  array (
    0 => 'mongodb-bson-persistable.bsonserialize.php',
    1 => 'MongoDB\\BSON\\Persistable::bsonSerialize',
  ),
  'next' => 
  array (
    0 => 'mongodb-bson-serializable.bsonserialize.php',
    1 => 'MongoDB\\BSON\\Serializable::bsonSerialize',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/bson/serializable.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.mongodb-bson-serializable.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.mongodb-bson-serializable" class="reference">

 <h1 class="title">The MongoDB\BSON\Serializable interface</h1>
 

 <div class="partintro"><p class="verinfo">(mongodb &gt;=1.0.0)</p>


  <div class="section" id="mongodb-bson-serializable.intro">
   <h2 class="title">Einführung</h2>
   <p class="simpara">
    Classes that implement this interface may return data to be serialized as a
    BSON array or document in lieu of the object&#039;s public properties.
   </p>
  </div>


  <div class="section" id="mongodb-bson-serializable.synopsis">
   <h2 class="title">Interface-Übersicht</h2>


   <div class="classsynopsis">
    <span class="ooclass"><strong class="classname"></strong></span>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">MongoDB\BSON\Serializable</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.mongodb-bson-type.php" class="interfacename">MongoDB\BSON\Type</a></span> {</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methoden */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span> <span class="methodname"><a href="mongodb-bson-serializable.bsonserialize.php" class="methodname">bsonSerialize</a></span>(): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="class.stdclass.php" class="type stdClass">stdClass</a></span>|<span class="type"><a href="class.mongodb-bson-document.php" class="type MongoDB\BSON\Document">MongoDB\BSON\Document</a></span>|<span class="type"><a href="class.mongodb-bson-packedarray.php" class="type MongoDB\BSON\PackedArray">MongoDB\BSON\PackedArray</a></span></span></div>

   }</div>


  </div>

  <div class="section">
   <h2 class="title">Changelog</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Beschreibung</th>
      </tr>

     </thead>

     <tbody class="tbody">
      
       <tr>
        <td>PECL mongodb 2.0.0</td>
        <td>
         Rückgabetypen, die zuvor als vorläufig deklariert waren, werden nun erzwungen.
        </td>
       </tr>


      
       <tr>
        <td>PECL mongodb 1.15.0</td>
        <td>
         Rückgabetypen für Methoden werden in PHP 8.0 und neuer als vorläufig
         deklariert, was in Code, der diese Schnittstelle implementiert, ohne
         die entsprechenden Rückgabetypen zu deklarieren, einen Hinweis auf eine
         veraltete Verwendung auslöst. Um diesen Hinweis zu unterdrücken, kann
         das Attribut <code class="code">#[ReturnTypeWillChange]</code> hinzugefügt werden.
        </td>
       </tr>


     </tbody>
    
   </table>

  </div>
 </div>

 







<h2>Inhaltsverzeichnis</h2><ul class="chunklist chunklist_reference"><li><a href="mongodb-bson-serializable.bsonserialize.php">MongoDB\BSON\Serializable::bsonSerialize</a> — Provides an array or document to serialize as BSON</li></ul>
</div>
<?php manual_footer($setup); ?>