PHP 8.5.0 Beta 3 available for testing

SolrDocument::toArray

(PECL solr >= 0.9.2)

SolrDocument::toArray โ€” ๆ–‡ๆ›ธใฎ้…ๅˆ—่กจ็พใ‚’่ฟ”ใ™

่ชฌๆ˜Ž

public SolrDocument::toArray(): array

ๆ–‡ๆ›ธใฎ้…ๅˆ—่กจ็พใ‚’่ฟ”ใ—ใพใ™ใ€‚

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

ใ“ใฎ้–ขๆ•ฐใซใฏใƒ‘ใƒฉใƒกใƒผใ‚ฟใฏใ‚ใ‚Šใพใ›ใ‚“ใ€‚

ๆˆปใ‚Šๅ€ค

ๆ–‡ๆ›ธใฎ้…ๅˆ—่กจ็พใ‚’่ฟ”ใ—ใพใ™ใ€‚

ไพ‹

ไพ‹1 SolrDocument::toArray() ใฎไพ‹

<?php

$doc
= new SolrDocument();

$doc->addField('id', 1123);

$doc->features = "PHP Client Side";
$doc->features = "Fast development cycles";

$doc['cat'] = 'Software';
$doc['cat'] = 'Custom Search';
$doc->cat = 'Information Technology';

print_r($doc->toArray());

?>

ไธŠใฎไพ‹ใฎๅ‡บๅŠ›ใฏใ€ ใŸใจใˆใฐไปฅไธ‹ใฎใ‚ˆใ†ใซใชใ‚Šใพใ™ใ€‚

Array
(
    [document_boost] => 0
    [field_count] => 3
    [fields] => Array
        (
            [0] => SolrDocumentField Object
                (
                    [name] => id
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => 1123
                        )

                )

            [1] => SolrDocumentField Object
                (
                    [name] => features
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => PHP Client Side
                            [1] => Fast development cycles
                        )

                )

            [2] => SolrDocumentField Object
                (
                    [name] => cat
                    [boost] => 0
                    [values] => Array
                        (
                            [0] => Software
                            [1] => Custom Search
                            [2] => Information Technology
                        )

                )

        )

)

๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top