docs: tutorial
[awesomized/ext-ion] / docs / v0.1 / ion / : Tutorial / :4. Symbols, Tables and Catalogs.html
1 <!doctype html>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>
64. Symbols, Tables and Catalogs -
7 mdref
8 </title>
9 <meta property="og:title" content="ion/: Tutorial/:4. Symbols, Tables and Catalogs">
10 <meta name="viewport" content="width=1200, initial-scale=0.5">
11 <base href="/ext-ion/v0.1/">
12 <meta http-equiv="Content-Location" content="/ext-ion/v0.1/ion/: Tutorial/:4. Symbols, Tables and Catalogs">
13 <link rel="stylesheet" href="index.css">
14
15 <link rel="shortcut icon" href="/ext-ion/v0.1/favicon.ico">
16 </head>
17 <body>
18 <div class="page">
19
20 <div class="sidebar">
21
22 <div class="edit">
23 <a href="https://github.com/awesomized/ext-ion/edit/master/ion.stub.php">Edit</a>
24 </div>
25
26
27 <ul>
28 <li>&lsh; <a href="./">Home</a>
29
30 <ul>
31 <li>
32
33 &uarr; <a href="./ion">
34 ion
35 </a>
36 <ul>
37 <li>
38
39 &uarr; <a href="./ion/: Tutorial">
40 ★ Tutorial
41 </a>
42 <ul>
43 <li>
44
45 &circlearrowright; <strong><a href="./ion/: Tutorial/:4. Symbols, Tables and Catalogs">4. Symbols, Tables and Catalogs</a></strong>
46
47
48
49 </ul>
50
51 <li>&ldsh; <a href="./ion/: Tutorial/:1. Getting started">1. Getting started</a></li>
52
53 <li>&ldsh; <a href="./ion/: Tutorial/:2. What is ion">2. What is ion</a></li>
54
55 <li>&ldsh; <a href="./ion/: Tutorial/:3. Standard Datatypes">3. Standard Datatypes</a></li>
56
57 <li>&ldsh; <a href="./ion/: Tutorial/:4. Special Datatypes">4. Special Datatypes</a></li>
58
59 <li>&ldsh; <a href="./ion/: Tutorial/:5. Symbols, Tables and Catalogs">5. Symbols, Tables and Catalogs</a></li>
60
61 <li>&ldsh; <a href="./ion/: Tutorial/Untitled">Untitled</a></li>
62
63 </ul>
64
65 </li>
66 </ul>
67
68 </li>
69 </ul>
70 </div>
71 <meta charset="utf-8"><h1>
72 <a class="permalink" href="ion/:%20Tutorial/:4.%20Symbols,%20Tables%20and%20Catalogs#">#</a>Symbols, Tables and Catalogs</h1><h2 id="Catalog">Catalog<a class="permalink" href="ion/:%20Tutorial/:4.%20Symbols,%20Tables%20and%20Catalogs#Catalog">#</a>
73 </h2><p>The Catalog holds a collection of <a href="ion/Symbol/Table">ion\Symbol\Table</a> instances queried from <a href="ion/Reader">ion\Reader</a> and <a href="ion/Writer">ion\Writer</a> instances.</p><p>See also <a href="https://amzn.github.io/ion-docs/docs/symbols.html#the-catalog">the ION spec's symbol guide chapter on catalog</a>.</p><pre><code><span style="color: inherit" class="html">
74 <span style="color: inherit" class="default">&lt;?php<br>$catalog </span><span style="color: inherit" class="keyword">= new </span><span style="color: inherit" class="default">ion\Catalog</span><span style="color: inherit" class="keyword">;<br></span><span style="color: inherit" class="default">$symtab </span><span style="color: inherit" class="keyword"></span><span style="color: inherit" class="default">ion\Symbol\PHP</span><span style="color: inherit" class="keyword">::</span><span style="color: inherit" class="default">asTable</span><span style="color: inherit" class="keyword">();<br></span><span style="color: inherit" class="default">$catalog</span><span style="color: inherit" class="keyword">-&gt;</span><span style="color: inherit" class="default">add</span><span style="color: inherit" class="keyword">(</span><span style="color: inherit" class="default">$symtab</span><span style="color: inherit" class="keyword">);<br></span><span style="color: inherit" class="default">?&gt;<br></span>
75 </span>
76 </code></pre>
77 <div class="comments">
78 <style>.giscus-frame {min-height: 16em;}</style>
79 <script>
80 function giscus_load(button) {
81 let script = document.createElement("script");
82 script.setAttribute("data-repo", 'awesomized/ext-ion');
83 script.setAttribute("data-category", 'Comments on Docs');
84 script.setAttribute("data-repo-id", 'R_kgDOGfXEXw');
85 script.setAttribute("data-category-id", 'DIC_kwDOGfXEX84CBHuf');
86 script.setAttribute("data-mapping", 'og:title');
87 script.setAttribute("data-input-position", 'bottom');
88 script.setAttribute("data-reactions-enabled", false);
89 script.setAttribute("data-theme", 'light');
90 script.setAttribute("data-lang", 'en');
91
92 script.src = "//giscus.app/client.js";
93 button.parentNode.replaceChild(script, button);
94 }
95 </script>
96 <button class="activator" onclick="giscus_load(this)">Show Comments from Github Discussions</button>
97
98 </div>
99
100 <footer>
101
102 <ul>
103 <li><a href="https://github.com/m6w6/mdref">mdref-v3.0
104 </a></li>
105 <li><a href="LICENSE">&copy; 2013-2022 All rights reserved.</a></li>
106 <li>
107 </li>
108 </ul>
109
110 </footer>
111
112 <script src="index.js" defer></script>
113
114 </div>
115 </body>
116 </html>