diff --git a/404.html b/404.html index 0cbbaf40b..05f5f9a60 100644 --- a/404.html +++ b/404.html @@ -14,7 +14,7 @@ - +
diff --git a/assets/js/3dd307b5.7f7edc87.js b/assets/js/3dd307b5.dc00c88e.js similarity index 97% rename from assets/js/3dd307b5.7f7edc87.js rename to assets/js/3dd307b5.dc00c88e.js index 8e720b0b2..97ccf800c 100644 --- a/assets/js/3dd307b5.7f7edc87.js +++ b/assets/js/3dd307b5.dc00c88e.js @@ -1 +1 @@ -"use strict";(self.webpackChunktinyorm_org=self.webpackChunktinyorm_org||[]).push([[117],{4251:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>u,frontMatter:()=>l,metadata:()=>d,toc:()=>a});var s=t(4848),o=t(8453),r=t(8774);const l={sidebar_position:2,sidebar_label:"Collections",description:"The ModelsCollection is specialized container which provides a fluent, convenient wrapper for working with vector of models. Is much more powerful than vectors and expose a variety of map / reduce operations that may be chained using an intuitive interface. All TinyORM methods that return more than one model result will return instances of the ModelsCollection class.",keywords:["c++ orm","orm","collections","collection","model","tinyorm"]},i="TinyORM: Collections",d={id:"tinyorm/collections",title:"TinyORM: Collections",description:"The ModelsCollection is specialized container which provides a fluent, convenient wrapper for working with vector of models. Is much more powerful than vectors and expose a variety of map / reduce operations that may be chained using an intuitive interface. All TinyORM methods that return more than one model result will return instances of the ModelsCollection class.",source:"@site/docs/tinyorm/collections.mdx",sourceDirName:"tinyorm",slug:"/tinyorm/collections",permalink:"/tinyorm/collections",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:2,frontMatter:{sidebar_position:2,sidebar_label:"Collections",description:"The ModelsCollection is specialized container which provides a fluent, convenient wrapper for working with vector of models. Is much more powerful than vectors and expose a variety of map / reduce operations that may be chained using an intuitive interface. All TinyORM methods that return more than one model result will return instances of the ModelsCollection class.",keywords:["c++ orm","orm","collections","collection","model","tinyorm"]},sidebar:"tinyormSidebar",previous:{title:"Relationships",permalink:"/tinyorm/relationships"},next:{title:"Casts",permalink:"/tinyorm/casts"}},c={},a=[{value:"Introduction",id:"introduction",level:2},{value:"Collection Conversion",id:"collection-conversion",level:4},{value:"Creating Collections",id:"creating-collections",level:3},{value:"Available Methods",id:"available-methods",level:2},{value:"all()
",id:"method-all",level:4},{value:"contains()
",id:"method-contains",level:4},{value:"doesntContain()
",id:"method-doesntcontain",level:4},{value:"each()
",id:"method-each",level:4},{value:"except()
",id:"method-except",level:4},{value:"filter()
",id:"method-filter",level:4},{value:"find()
",id:"method-find",level:4},{value:"first()
",id:"method-first",level:4},{value:"firstWhere()
",id:"method-first-where",level:4},{value:"fresh()
",id:"method-fresh",level:4},{value:"implode()
",id:"method-implode",level:4},{value:"isEmpty()
",id:"method-isempty",level:4},{value:"isNotEmpty()
",id:"method-isnotempty",level:4},{value:"last()
",id:"method-last",level:4},{value:"load()
",id:"method-load",level:4},{value:"map()
",id:"method-map",level:4},{value:"mapWithKeys()
",id:"method-mapwithkeys",level:4},{value:"mapWithModelKeys()
",id:"method-mapwithmodelkeys",level:4},{value:"modelKeys()
",id:"method-modelkeys",level:4},{value:"only()
",id:"method-only",level:4},{value:"pluck()
",id:"method-pluck",level:4},{value:"reject()
",id:"method-reject",level:4},{value:"sort()
",id:"method-sort",level:4},{value:"sortBy()
",id:"method-sortby",level:4},{value:"sortByDesc()
",id:"method-sortbydesc",level:4},{value:"sortDesc()
",id:"method-sortdesc",level:4},{value:"stableSort()
",id:"method-stablesort",level:4},{value:"stableSortBy()
",id:"method-stablesortby",level:4},{value:"stableSortByDesc()
",id:"method-stablesortbydesc",level:4},{value:"stableSortDesc()
",id:"method-stablesortdesc",level:4},{value:"tap()
",id:"method-tap",level:4},{value:"toBase()
",id:"method-tobase",level:4},{value:"toJson()
",id:"method-tojson",level:4},{value:"toJsonArray()
",id:"method-tojsonarray",level:4},{value:"toJsonDocument()
",id:"method-tojsondocument",level:4},{value:"toMap()
",id:"method-tomap",level:4},{value:"toMapVariantList()
",id:"method-tomapvariantlist",level:4},{value:"toQuery()
",id:"method-toquery",level:4},{value:"toList()
",id:"method-tolist",level:4},{value:"toListVariantList()
",id:"method-tolistvariantlist",level:4},{value:"unique()
",id:"method-unique",level:4},{value:"uniqueBy()
",id:"method-uniqueby",level:4},{value:"uniqueRelaxed()
",id:"method-uniquerelaxed",level:4},{value:"uniqueRelaxedBy()
",id:"method-uniquerelaxedby",level:4},{value:"value()
",id:"method-value",level:4},{value:"where()
",id:"method-where",level:4},{value:"whereBetween()
",id:"method-wherebetween",level:4},{value:"whereIn()
",id:"method-wherein",level:4},{value:"whereNotBetween()
",id:"method-wherenotbetween",level:4},{value:"whereNotIn()
",id:"method-wherenotin",level:4},{value:"whereNotNull()
",id:"method-wherenotnull",level:4},{value:"whereNull()
",id:"method-wherenull",level:4}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"tinyorm-collections",children:"TinyORM: Collections"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#introduction",children:"Introduction"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#creating-collections",children:"Creating Collections"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#available-methods",children:"Available Methods"})}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)("div",{class:"api-stability alert alert--success",children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(r.A,{to:"/stability#stability-indexes",children:(0,s.jsx)(n.strong,{children:"Stability: 2"})})," - Stable"]})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"Orm::Tiny::Types::ModelsCollection"})," is specialized container which provides a fluent, convenient wrapper for working with vector of models. All TinyORM methods that return more than one model result, will return instances of the ",(0,s.jsx)(n.code,{children:"ModelsCollection"})," class, including results retrieved via the ",(0,s.jsx)(n.code,{children:"get"})," method or methods that return relationships like the ",(0,s.jsx)(n.code,{children:"getRelation"})," and ",(0,s.jsx)(n.code,{children:"getRelationValue"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"ModelsCollection"})," class extends ",(0,s.jsx)(n.code,{children:"QListall()
",id:"method-all",level:4},{value:"contains()
",id:"method-contains",level:4},{value:"doesntContain()
",id:"method-doesntcontain",level:4},{value:"each()
",id:"method-each",level:4},{value:"except()
",id:"method-except",level:4},{value:"filter()
",id:"method-filter",level:4},{value:"find()
",id:"method-find",level:4},{value:"first()
",id:"method-first",level:4},{value:"firstWhere()
",id:"method-first-where",level:4},{value:"fresh()
",id:"method-fresh",level:4},{value:"implode()
",id:"method-implode",level:4},{value:"isEmpty()
",id:"method-isempty",level:4},{value:"isNotEmpty()
",id:"method-isnotempty",level:4},{value:"last()
",id:"method-last",level:4},{value:"load()
",id:"method-load",level:4},{value:"map()
",id:"method-map",level:4},{value:"mapWithKeys()
",id:"method-mapwithkeys",level:4},{value:"mapWithModelKeys()
",id:"method-mapwithmodelkeys",level:4},{value:"modelKeys()
",id:"method-modelkeys",level:4},{value:"only()
",id:"method-only",level:4},{value:"pluck()
",id:"method-pluck",level:4},{value:"reject()
",id:"method-reject",level:4},{value:"sort()
",id:"method-sort",level:4},{value:"sortBy()
",id:"method-sortby",level:4},{value:"sortByDesc()
",id:"method-sortbydesc",level:4},{value:"sortDesc()
",id:"method-sortdesc",level:4},{value:"stableSort()
",id:"method-stablesort",level:4},{value:"stableSortBy()
",id:"method-stablesortby",level:4},{value:"stableSortByDesc()
",id:"method-stablesortbydesc",level:4},{value:"stableSortDesc()
",id:"method-stablesortdesc",level:4},{value:"tap()
",id:"method-tap",level:4},{value:"toBase()
",id:"method-tobase",level:4},{value:"toJson()
",id:"method-tojson",level:4},{value:"toJsonArray()
",id:"method-tojsonarray",level:4},{value:"toJsonDocument()
",id:"method-tojsondocument",level:4},{value:"toMap()
",id:"method-tomap",level:4},{value:"toMapVariantList()
",id:"method-tomapvariantlist",level:4},{value:"toQuery()
",id:"method-toquery",level:4},{value:"toList()
",id:"method-tolist",level:4},{value:"toListVariantList()
",id:"method-tolistvariantlist",level:4},{value:"unique()
",id:"method-unique",level:4},{value:"uniqueBy()
",id:"method-uniqueby",level:4},{value:"uniqueRelaxed()
",id:"method-uniquerelaxed",level:4},{value:"uniqueRelaxedBy()
",id:"method-uniquerelaxedby",level:4},{value:"value()
",id:"method-value",level:4},{value:"where()
",id:"method-where",level:4},{value:"whereBetween()
",id:"method-wherebetween",level:4},{value:"whereIn()
",id:"method-wherein",level:4},{value:"whereNotBetween()
",id:"method-wherenotbetween",level:4},{value:"whereNotIn()
",id:"method-wherenotin",level:4},{value:"whereNotNull()
",id:"method-wherenotnull",level:4},{value:"whereNull()
",id:"method-wherenull",level:4}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"tinyorm-collections",children:"TinyORM: Collections"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:[(0,s.jsx)(n.a,{href:"#introduction",children:"Introduction"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#creating-collections",children:"Creating Collections"})}),"\n"]}),"\n"]}),"\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"#available-methods",children:"Available Methods"})}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"introduction",children:"Introduction"}),"\n",(0,s.jsx)("div",{class:"api-stability alert alert--success",children:(0,s.jsxs)(n.p,{children:[(0,s.jsx)(r.A,{to:"/stability#stability-indexes",children:(0,s.jsx)(n.strong,{children:"Stability: 2"})})," - Stable"]})}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"Orm::Tiny::Types::ModelsCollection"})," is specialized container which provides a fluent, convenient wrapper for working with vector of models. All TinyORM methods that return more than one model result, will return instances of the ",(0,s.jsx)(n.code,{children:"ModelsCollection"})," class, including results retrieved via the ",(0,s.jsx)(n.code,{children:"get"})," method or methods that return relationships like the ",(0,s.jsx)(n.code,{children:"getRelation"})," and ",(0,s.jsx)(n.code,{children:"getRelationValue"}),"."]}),"\n",(0,s.jsxs)(n.p,{children:["The ",(0,s.jsx)(n.code,{children:"ModelsCollection"})," class extends ",(0,s.jsx)(n.code,{children:"QListFor a better understanding of the following examples, many of the variable declarations below use actual types instead of the auto
keyword.