
offsetGet 메소드는 SolrDocument 클래스의 속성을 읽어오는 메소드입니다.
offsetGet 메소드는 한 개의 매개변수를 받는데, 이는 읽어올 속성의 이름입니다.
offsetGet 메소드는 해당 속성의 값을 반환합니다.
위 코드에서 offsetGet 메소드는 속성 'name'의 값을 'John Doe'로, 속성 'age'의 값을 30으로 반환합니다.
offsetGet 메소드는 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$document = new SolrDocument();
$document->offsetSet('name', 'John Doe');
$document->offsetSet('age', 30);
echo $document->offsetGet('name'); // John Doe
echo $document->offsetGet('age'); // 30
offsetGet 메소드는 속성을 읽어오기 때문에, 읽어올 속성이 없으면 null을 반환합니다.
#hostingforum.kr
php
$document = new SolrDocument();
echo $document->offsetGet('name'); // null
2025-07-10 20:48