<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://docs.instantcms.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://docs.instantcms.ru/feed.php">
        <title>Документация InstantCMS - en:dev:data</title>
        <description>для администраторов и разработчиков</description>
        <link>https://docs.instantcms.ru/</link>
        <image rdf:resource="https://docs.instantcms.ru/_media/wiki/dokuwiki.svg" />
       <dc:date>2026-11-19T02:46:03+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://docs.instantcms.ru/en/dev/data/ups?rev=1490709386"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://docs.instantcms.ru/_media/wiki/dokuwiki.svg">
        <title>Документация InstantCMS</title>
        <link>https://docs.instantcms.ru/</link>
        <url>https://docs.instantcms.ru/_media/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://docs.instantcms.ru/en/dev/data/ups?rev=1490709386">
        <dc:format>text/html</dc:format>
        <dc:date>2017-03-28T13:56:26+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Universal Private Settings</title>
        <link>https://docs.instantcms.ru/en/dev/data/ups?rev=1490709386</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;universal-private-settings&quot;&gt;Universal Private Settings&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
The mechanism of universal private settings, UPS in short, allows to save the unique settings of each individual user. This is necessary when session and cookies are not suitable for storing such data because of various reasons. At the same time, you are not expected to store very important data, because it can be cleared once to optimize the database, use a custom table for such data instead.
&lt;/p&gt;

&lt;p&gt;
A user ID and a unique key of this option is used to store the data. For example, your component is called “raduga” and you are going to save color, so the key will look like this: «raduga.color».
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Universal Private Settings&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;universal-private-settings&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-642&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;saving-data&quot;&gt;Saving Data&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;setUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;'blue'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
Use the third argument with user ID to save it not for the current but any other user; this concerns all UPS methods:
&lt;/p&gt;
&lt;pre class=&quot;code php&quot;&gt;cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;setUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;'blue'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Saving Data&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;saving-data&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;643-908&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit3&quot; id=&quot;receiving-data&quot;&gt;Receiving Data&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;getUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Receiving Data&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;receiving-data&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;909-996&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;deleting-data&quot;&gt;Deleting Data&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;pre class=&quot;code php&quot;&gt;cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;deleteUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code php&quot;&gt;cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;deleteUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// we will delete the data of a user with the id 12&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;
If you have just received new data and do not know if it has been saved before and whether it coinsides with the old one, then use the method that will check if:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; the variable with the data is not empty&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; new data does not coinside with the old one and will refresh it if needed&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; will return actual data&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// null&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;getUPSActual&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;//  will return blue from the example above&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;getUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// will return blue&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;code php&quot;&gt;&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$this&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// red&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;getUPSActual&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// will return red and will save it in the DB&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;$color&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; cmsUser&lt;span class=&quot;sy0&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;me2&quot;&gt;getUPS&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st_h&quot;&gt;'raduga.color'&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// will return red &lt;/span&gt;&lt;/pre&gt;
&lt;hr /&gt;

&lt;p&gt;
&lt;a href=&quot;https://docs.instantcms.ru/en/dev/data&quot; class=&quot;wikilink1&quot; title=&quot;en:dev:data&quot; data-wiki-id=&quot;en:dev:data&quot;&gt;Back to ‘’Different data storing” Section Contents&lt;/a&gt;
&lt;/p&gt;
&lt;hr /&gt;

&lt;p&gt;
&lt;a href=&quot;https://docs.instantcms.ru/en/dev/start&quot; class=&quot;wikilink2&quot; title=&quot;en:dev:start&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;en:dev:start&quot;&gt;Back to Section Contents&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Deleting Data&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;deleting-data&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;997-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
