Parse attached objects and set default update count callback.

@param array $objects

@return TaxonomyInterface
437012
protected function parseObjectsForCustomStatus(array $objects): TaxonomyInterface
    {
        foreach ($objects as $object) {
            if ($this->container->bound('themosis.posttype.'.$object)) {
                $postType = $this->container['themosis.posttype.'.$object];

                if ($postType->hasStatus()) {
                    $this->setArguments([
                        'update_count_callback' => '_update_generic_term_count'
                    ]);
                    break;
                }
            }
        }

        return $this;
    }
955174
public function fromArray($objects)
    {
        $this->clear();
        foreach ($objects as $objectData) {
            $this->add($objectData);
        }
    }
170931
private function getClass($array, &$objects)
    {
        foreach ($array as $el) {
            if (is_object($el)) {
                $objects = $array;

                $class = get_class($el);
            } else {
                if (is_array($el)) {
                    $class = $this->getClass($el, $objects);
                }
            }
        }

        return $class;
    }
1146728
public static function get(array $object, $keys)
    {
        $parts = explode('.', $keys);
        $key = array_shift($parts);

        if (isset($object[$key])) {
            if (!empty($parts) && is_array($object[$key])) {
                return static::get($object[$key], implode('.', $parts));
            }

            return $object[$key];
        }

        if (array_key_exists($key, $object)) {
            return null;
        }
        throw new \Exception("Key `{$keys}` doesn't exist for array keys [".implode(',', array_keys($object)).']');
    }
879211
public static function clean(array $objects) {
			foreach ($objects as $k => $obj) {
				$fields = self::getSObjectFields($obj);

				if ($fields === null) {
					unset($objects[$k]);

					continue;
				}

				foreach ($fields as $k => $v) {
					if ($v === null || is_string($v) && strlen($v) === 0) {
						if (!isset($obj->fieldsToNull))
							$obj->fieldsToNull = [];

						$obj->fieldsToNull[] = $k;

						unset($fields[$k]);

						continue;
					}

					$fields[$k] = $this->converter->convertForUpdateOrCreate($v);
				}

				$obj = self::updateSObjectFields($obj, $fields);
			}

			return $objects;
		}
36903
protected function createAnnotationObjects(array $annotations)
    {
        $objects     = array();

        //var_dump($annotations);

        foreach ($annotations as $name => $args) {
            $name = ucfirst($name);
            $class = $this->defaultNamespace . $name . 'Annotation';

            if (in_array(strtolower($name), self::getExcludeAnnotationList())) {
                continue;
            }

            if (! array_key_exists($class, $objects)) {
                if (!class_exists($class)) {
                    if ($this->strict) {
                        throw new \Exception(sprintf('Annotation Class Not Found: %s', $class));
                    } else {
                        continue;
                    }
                }

                $objects[$name] = new $class();
            }
            //var_dump($args);
            foreach ($args as $key => $value) {
                $objects[$name]->set($key, $value);
            }
        }

        return $objects;
    }
1242006
public static function parse_object_id( $object ) {
		if ( is_numeric( $object ) && $object > 0 ) {
			return (int) $object;
		} elseif ( ! empty( $object->ID ) ) {
			return (int) $object->ID;
		} elseif ( ! empty( $object->term_id ) ) {
			return (int) $object->term_id;
		} elseif ( $object instanceof WP_Object ) {
			return $object->get_id();
		}
	}
1154440
public function deleteObjects($bucket, array $objects)
    {
        $params = [
            'Bucket'  => $bucket,
            'Objects' => []
        ];
        foreach ($objects as $object) {
            $objects[] = [
                'Key' => $object
            ];
        }

        return $this->instance->deleteObjects($params);
    }
404091
public function setObjectActions(array $actions)
    {
        $this->parsedObjectActions = false;

        $actions = $this->mergeActions($this->defaultObjectActions(), $actions);

        /** Enable seamless button group */
        if (isset($actions['edit'])) {
            $actions['edit']['actionType'] = 'seamless';
        }

        $this->objectActions = $actions;

        return $this;
    }
885807
public function setObjects($objects)
    {
        if (!is_array($objects)) {
            $objects = [$objects];
        }

        $this->objects = [];
        foreach ($objects as $object) {
            if (is_string($object)) {
                $vObj = Reader::read($object);
                if (!$vObj instanceof Component\VCard) {
                    throw new \InvalidArgumentException('String could not be parsed as \\Sabre\\VObject\\Component\\VCard by setObjects');
                }

                $this->objects[] = $vObj;
            } elseif ($object instanceof Component\VCard) {
                $this->objects[] = $object;
            } else {
                throw new \InvalidArgumentException('You can only pass strings or \\Sabre\\VObject\\Component\\VCard arguments to setObjects');
            }
        }
    }
1181256
private function _setFields($object, $fields)
    {
        $fields = is_array($fields) ? $fields : [];
        foreach ($fields as $sKey => $sValue) {
            $object->$sKey = oxNew('oxField', $sValue);
        }

        return $object;
    }
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;
    }
820294
final protected function checkArrayCollection($object)
    {
        return $object instanceof \Doctrine\Common\Collections\ArrayCollection || $object instanceof \Doctrine\ORM\PersistentCollection;
    }
162578
public function setAttachmentDefaults($defaults)
    {
        if ($this->attachmentDefaults != ($defaults = (array) $defaults)) {
            $this->attachmentDefaults = $defaults;

            $this->setAttachments($this->attachments);
        }

        return $this;
    }
996678
public function convertArrayToObjects(array $mediaQueryRules, array $objects = array())
    {
        foreach ($mediaQueryRules as $order => $ruleSet) {
            foreach (reset($ruleSet) as $rule) {
                $objects = array_merge($objects, $this->convertToObjects(key($ruleSet), $rule, $order));
            }
        }

        return $objects;
    }
64182
public function objectsFromIndexes(IObjectSetWithIdentityByIndex $objects) : ObjectArrayFieldBuilder
    {
        return (new ObjectArrayFieldBuilder($this
            ->type(new ArrayOfObjectIdsType(
                $objects,
                Field::element()->objectFromIndex($objects)->required()->build(),
                $loadAsObjects = true
            ))
        ));
    }
976861
public function from_post( $object )
	{
		if ( is_array( $object ) ) {

			$this->attributes = $object;

		} else if ( is_a( $object, 'WP_Post' ) ) {

			$this->attributes = $object->to_array();

		}

		if ( ! empty( $this->attributes ) ) {

			$this->load_meta();
			
		}

		return $this;
	}