Get all titles for a given Yahoo SERP page.
@param  SimpleHtmlDom $SHDObject
@return array
497808
protected function getPageTitles($SHDObject)
    {
        $titles = array();
        foreach($SHDObject->find('.compTitle h3.title') as $object) {
            // extract and clean anchors innertext
            $titleText = $object->innertext;
            $titles[]  = $this->cleanText($titleText);
        }
        // fetch only organic results
        return $this->normalizeResult($titles);
    }
941335
function fetchAttributeTranslations( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                                    null,
                                                    array( "contentclassattribute_id" => $this->ContentClassAttributeID,
                                                           "contentobject_id" => $this->ContentObjectID,
                                                           "version" => $this->Version ),
                                                    null,
                                                    null,
                                                    $asObject);
    }
967195
public function normalize(TypeDoc $docObject) : array
    {
        $docArray = [];

        $docArray = $this->appendIfNotNull($docArray, 'description', $docObject->getDescription());

        return $docArray
            + ['type' => $this->normalizeSchemaType($docObject)]
            + ['nullable' => $docObject->isNullable()]
            + ['required' => $docObject->isRequired()]
            + $this->appendMisc($docObject)
            + $this->appendDocEnum($docObject)
            + $this->appendMinMax($docObject)
            + $this->appendCollectionDoc($docObject)
        ;
    }
905093
public function getTitle($allowBasicTags = false)
    {
        $titleParts = [];

        if ($allowBasicTags === true) {
            $allowedTags = '<b><del><em><i><strong><s>';
        } else {
            $allowedTags = '';
        }

        foreach ($this->getTitleColumnName() as $fieldName) {
            // Make sure we add strings only, as some fields may be an array or DateTime.
            $value = is_array($this->values[$fieldName]) ? implode(' ', $this->values[$fieldName]) : (string) $this->values[$fieldName];
            if (strip_tags($value, $allowedTags) !== '') {
                $titleParts[] = strip_tags($value, $allowedTags);
            }
        }

        if (!empty($titleParts)) {
            $title = implode(' ', $titleParts);
        } else {
            // nope, no title was found.
            $title = '';
        }

        return $title;
    }
909440
public function deserialize($serializedObject, $objectClass)
    {
        $result = json_decode($serializedObject, true);

        $article = $this->serializer->deserialize(
            $result['object'],
            $this->articleDocumentClass,
            'json',
            DeserializationContext::create()
                ->setSerializeNull(true)
                ->setGroups(['preview'])
        );

        foreach ($article->getChildren() as $child) {
            $child->setParent($article);
        }

        if (1 === $result['pageNumber']) {
            return $article;
        }

        $children = array_values($article->getChildren());

        $object = $children[$result['pageNumber'] - 2];

        return $object;
    }
430033
public function xmlToArray($xmlObject, $output = array())
    {
        foreach ((array) $xmlObject as $index => $node) {
            $output[$index] = ($node instanceof \SimpleXMLElement || is_array($node))
                ? $this->xmlToArray($node)
                : $node;
        }

        return $output;
    }
1263096
function translationList( $language = false, $asObject = true )
    {
        $db = eZDB::instance();

        $languageSQL = '';
        if ( $language !== false )
        {
            $language = $db->escapeString( $language );
            $languageSQL = "AND language_code!='$language'";
        }

        $query = "SELECT DISTINCT language_code
                  FROM ezcontentobject_attribute
                  WHERE contentobject_id='$this->ContentObjectID' AND version='$this->Version'
                  $languageSQL
                  ORDER BY language_code";

        $languageCodes = $db->arrayQuery( $query );

        $translations = array();
        if ( $asObject )
        {
            foreach ( $languageCodes as $languageCode )
            {
                $translations[] = new eZContentObjectTranslation( $this->ContentObjectID, $this->Version, $languageCode["language_code"] );
            }
        }
        else
        {
            foreach ( $languageCodes as $languageCode )
            {
                $translations[] = $languageCode["language_code"];
            }
        }

        return $translations;
    }
657687
protected function appendMinMax(TypeDoc $docObject) : array
    {
        $docArray = [];
        if ($docObject instanceof StringDoc) {
            $docArray = $this->appendIfNotNull($docArray, 'minLength', $docObject->getMinLength());
            $docArray = $this->appendIfNotNull($docArray, 'maxLength', $docObject->getMaxLength());
        } elseif ($docObject instanceof CollectionDoc) {
            $docArray = $this->appendIfNotNull($docArray, 'minItem', $docObject->getMinItem());
            $docArray = $this->appendIfNotNull($docArray, 'maxItem', $docObject->getMaxItem());
        } elseif ($docObject instanceof NumberDoc) {
            return $this->appendNumberMinMax($docObject);
        }

        return $docArray;
    }
304571
public function getAllSegmentsForAllUsers($idSite = false)
    {
        $bind = array();
        $sqlWhereCondition = '';

        if(!empty($idSite)) {
            $bind = array($idSite);
            $sqlWhereCondition = '(enable_only_idsite = ? OR enable_only_idsite = 0) AND';
        }

        $sqlWhereCondition  = $this->buildQuerySortedByName($sqlWhereCondition . ' deleted = 0');
        $segments = $this->getDb()->fetchAll($sqlWhereCondition, $bind);

        return $segments;
    }
1114726
function getTreeTitle() {
		$title = $this->Title;
		if (!$title) {
			$title = $this->Name;
		}

		$treeTitle = sprintf(
			"<span class=\"jstree-pageicon\"></span><span class=\"item\">%s</span>",
			Convert::raw2xml(str_replace(array("\n","\r"),"", $title))
		);
		return $treeTitle;
	}
37640
private function __getMethods($object)
    {
        $reflection = new ReflectionClass($object);
        
        //get all methods
        $methods = $reflection->getMethods();
        $this->builtInMethods = array();
        
        //get properties for each method
        if(!empty($methods))
        {
            foreach ($methods as $method) {
                if(!empty($method->name))
                {
                    $methodProp = new ReflectionMethod($object, $method->name);
                    
                    //saves all methods names found
                    $this->builtInMethods['all'][] = $method->name;
                    
                    //saves all private methods names found
                    if($methodProp->isPrivate()) 
                    {
                        $this->builtInMethods['private'][] = $method->name;
                    }
                    
                    //saves all private methods names found                 
                    if($methodProp->isPublic()) 
                    {
                        $this->builtInMethods['public'][] = $method->name;
                        
                        // gets info about the method and saves them. These info will be used for the xmlrpc server configuration.
                        // (only for public methods => avoids also all the public methods starting with '__')
                        if(!preg_match('/^__/', $method->name, $matches))
                        {
                            // -method name
                            $this->builtInMethods['functions'][$method->name]['function'] = $reflection->getName().'.'.$method->name;
                            
                            // -method docstring
                            $this->builtInMethods['functions'][$method->name]['docstring'] = $this->__extractDocString($methodProp->getDocComment());
                        }
                    }
                }
            }
        } else {
            return false;
        }
        return true;
    }
1183275
protected function infoArray(HttpServerDoc $doc) : array
    {
        $infoArray = [];
        $infoArray = $this->appendIfValueNotNull('title', $doc->getName(), $infoArray);
        $infoArray = $this->appendIfValueNotNull('version', $doc->getVersion(), $infoArray);

        return $this->appendIfValueHaveSiblings('info', $infoArray);
    }
776920
protected function _collectTags($object)
    {
        $tags = array(self::TAG_PREFIX . $object->getId());
        
        if ($this->_isForUpdate) {
            foreach ($object->getParentIds() as $categoryId) {
                $tags[] = self::TAG_PREFIX . $categoryId;
            }
        }
        
        return $tags;
    }
1344975
public static function getWebhookPayload($returnObject = false) {
        $data = file_get_contents("php://input");
        if ($data) {
            return self::jsonDecode($data, !$returnObject);
        } else {
            return null;
        }
    }
264882
static function fetchListByID( $idList ,$asObject = true )
    {
        $cond = array( 'id' => array( $idList ) );
        return eZPersistentObject::fetchObjectList( eZNodeAssignment::definition(),
                                                    null, $cond, null, null,
                                                    $asObject );
    }
1230044
public static function getAttachmentsList($object)
    {
        $fburl       = $object->getFlexiBeeURL();
        $attachments = [];
        $oFormat = $object->format;
        $object->setFormat('json');
        $atch        = $object->getFlexiData($fburl.'/prilohy'.(count($object->defaultUrlParams)
                ? '?'.http_build_query($object->defaultUrlParams) : ''));
        $object->setFormat($oFormat);
        if (count($atch) && ($object->lastResponseCode == 200)) {
            foreach ($atch as $attachmentID => $attachmentData) {
                $attachments[$attachmentID]        = $attachmentData;
                $attachments[$attachmentID]['url'] = $object->url.'/c/'.$object->company.'/priloha/'.$attachmentData['id'];
            }
        }
        return $attachments;
    }
1290595
public function get_title( $object ) {
		return $this->field->options( 'query_users' )
			? $object->data->display_name
			: get_the_title( $object );
	}