File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1945,6 +1945,41 @@ public function getColumnsFromAbraFlexi(
19451945 return $ flexiData ;
19461946 }
19471947
1948+ /**
1949+ * Return One document as Object.
1950+ *
1951+ * @todo Experimental
1952+ *
1953+ * @since 3.7.1
1954+ *
1955+ * @return self Current Document instance
1956+ */
1957+ public function getDocument (string $ identifier , array $ conditions = []): ?self
1958+ {
1959+ $ conditions ['id ' ] = $ this ->getEvidenceUrl ().'/ ' .Functions::urlizeId ($ identifier );
1960+ $ flexiData = $ this ->getFlexiData ('' , $ conditions );
1961+
1962+ return new self ($ flexiData );
1963+ }
1964+
1965+ /**
1966+ * Return Collection of Documents.
1967+ *
1968+ * @since 3.7.1
1969+ *
1970+ * @return \Ease\Collection<T> Collection of Documents
1971+ */
1972+ public function getDocuments (array $ filter = []): \Ease \Collection
1973+ {
1974+ $ documents = new \Ease \Collection ('\\AbraFlexi \\' .Functions::evidenceToClassName ($ this ->evidence ));
1975+
1976+ foreach ($ this ->getFlexiData ($ this ->getEvidenceUrl (), empty ($ filter ) ? '' : $ filter ) as $ record ) {
1977+ $ documents ->addArray ($ record );
1978+ }
1979+
1980+ return $ documents ;
1981+ }
1982+
19481983 /**
19491984 * Save RAW Curl Request & Response to files in Temp directory.
19501985 */
You can’t perform that action at this time.
0 commit comments