Go through the list of private tags and assign them to this object.

@param array $data JSON data from Hail
196627
protected function processPrivateTags($data)
    {
        $tagIdList = [];
        $this->PrivateTags()->removeAll();
        foreach ($data as $tagData) {
            $tagIdList[] = $tagData['id'];

            // Find a matching PrivateTag or create an new one
            $tag = PrivateTag::get()->filter(['HailID' => $tagData['id']])->first();

            if (!$tag) {
                $tag = new PrivateTag();
            }

            $tag->OrganisationID = $this->OrganisationID;
            $tag->HailOrgID = $this->HailOrgID;
            $tag->HailOrgName = $this->HailOrgName;

            // Update the Hail Tag
            $tag->importHailData($tagData);
            if (!$this->PrivateTags()->byID($tag->ID)) {
                $this->PrivateTags()->add($tag);
            }
        }
    }
464437
public function populate($data = array())
    {
        foreach (array('title', 'meta_keywords', 'meta_description', 'content', 'heading', 'category') as $attr) {
            if (isset($data[$attr]) && $data[$attr]!= null) {
                $this->$attr = $data[$attr];
            }
        }
        foreach (array('active', 'sort_order', 'pushHome', 'displayHome') as $attr) {
            if (isset($data[$attr])) {
                $this->$attr = (bool) $data[$attr];
            }
        }
        if (isset($data['category']) && $data['category']!= null) {
            $this->category = (int) $data['category'];
        }
    }
1279501
public function unmarshall(array $data = array())
    {
        $private_properties = array(
            'row_wrapper_class',
            'index_field',
            'options'
        );

        foreach ($private_properties as $property) {
            if (isset($data[$property])) {
                $this->$property = $data[$property];
            } else {
                $this->$property = null;
            }
        }

        $this->objects = array();
        $this->objects_by_index = array();
        if (is_subclass_of($this->row_wrapper_class, 'SwatDBMarshallable')) {
            if (isset($data['objects'])) {
                foreach ($data['objects'] as $object_data) {
                    $object = new $this->row_wrapper_class();
                    $object->unmarshall($object_data);
                    $this->objects[] = $object;
                }
            }
            if ($this->index_field != '') {
                $this->reindex();
            }
        }
    }
439791
protected function assign($data)
    {
        if (!is_null($data)) {
            foreach ($data as $key => $value) {
                $this->set($key, $value);
            }
        }
    }
1076792
public function setup($data = array())
	{

		foreach (self::$_KEYS as $k)
		{
			if (array_key_exists($k, $data))
			{
				$this->_API[$k] = self::verifySetup($k, $data[$k]);
			}
		}
	}
911039
public function setData($data = [])
    {
        if (!is_array($data) && is_string($data)) {
            $data = parse_str($data);
        }
        if (count($data) == 0) {
            $this->data = [];
        } else {
            $this->data = $data;
        }
        $this->debug->debug(__FUNCTION__, 'Data into Request: ', $this->data);
    }
101019
public function tag($tags)
    {
        $tags = $this->makeTagsArray($tags);

        $this->addTags($tags);

        if (count($tags) > 0) {
            $this->tags()->sync(
                Tag::whereIn('tag', $tags)->pluck('id')->all()
            );

            return;
        }

        $this->tags()->detach();
    }
1236522
final protected function sanitize($data)
    {
        // Recursively loop through the data array and return the sanitized data
        $sanitized = [];
        if (is_array($data)) {
            foreach ($data as $key => $value) {
                $sanitized[$key] = $this->sanitize($value);
            }
        } else {
            $sanitized = trim(strip_tags($data));
        }
        return $sanitized;
    }
378536
private function setData(array $data)
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        if (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT]) {
            $this->_result = $data;
        } else {
            $this->_result = [];

            if ($this->_options[self::ENTRY_TYPE] === Collection::TYPE_EDGE) {
                foreach ($data as $row) {
                    $this->_result[] = $_edgeClass::createFromArray($row, $this->_options);
                }
            } else {
                foreach ($data as $row) {
                    $this->_result[] = $_documentClass::createFromArray($row, $this->_options);
                }
            }
        }
    }
863450
public function set_data( $data ) {

		$this->instance = 0;
		foreach ( (array) $data[ $this->slug ] as $instance => $instance_data ) {
			foreach ( $this->child as $child ) {
				if ( method_exists( $child, 'set_data' ) ) {
					$child->set_data( $instance_data );
				}
			}
			$this->instance ++;
		}
		$this->instances = $this->instance;
		$this->instance  = 0;

	}
751950
protected function normalizedTags($data) : Collection
	{
		return $data->has('tags')
			? Collection::make($data->get('tags'))
			: $data->pluck('tags');
	}
791450
public function set(array $data)
	{
		foreach ($data as $key => $value)
		{
			if (isset(static::$_mass_whitelist))
			{
				in_array($key, static::$_mass_whitelist) and $this->_data[$key] = $value;
			}
			elseif (isset(static::$_mass_blacklist))
			{
				( ! in_array($key, static::$_mass_blacklist)) and $this->_data[$key] = $value;
			}
			else
			{
				// no static::$_mass_whitelist or static::$_mass_blacklist set, proceed with default behavior
				$this->_data[$key] = $value;
			}
		}
		return $this;
	}
604192
public function exchangeArray(array $data): void
    {
        foreach ($data as $key => $value) {
            $this->{$key} = (!empty($value)) ? $value : null;
        }
    }
157820
public function data($data = []) {
		$bind =& $this->_entity;

		if ($data) {
			$bind ? $bind->set($data) : $this->_data = array_merge($this->_data, $data);
			return $this;
		}
		$data = $bind ? $bind->data() : $this->_data;
		return ($list = $this->_config['whitelist']) ? array_intersect_key($data, $list) : $data;
	}
1140684
protected function process_data_record_tag($data) {
        $data = (object)$data;

        if (!core_tag_tag::is_enabled('mod_data', 'data_records')) { // Tags disabled in server, nothing to process.
            return;
        }

        if (!$itemid = $this->get_mappingid('data_record', $data->itemid)) {
            // Some orphaned tag, we could not find the data record for it - ignore.
            return;
        }

        $tag = $data->rawname;
        $context = context_module::instance($this->task->get_moduleid());
        core_tag_tag::add_item_tag('mod_data', 'data_records', $itemid, $context, $tag);
    }
952970
protected function processAttachments($data)
    {
        $idList = [];
        foreach ($data as $attachmentData) {
            $idList[] = $attachmentData['id'];

            // Find a matching attachment or create it
            $attachment = Attachment::get()->filter(['HailID' => $attachmentData['id']])->first();

            if (!$attachment) {
                $attachment = new Attachment();
            }
            $attachment->OrganisationID = $this->OrganisationID;
            $attachment->HailOrgID = $this->HailOrgID;
            $attachment->HailOrgName = $this->HailOrgName;

            // Update the Hail Attachments
            $attachment->importHailData($attachmentData);

            if (!$this->Attachments()->byID($attachment->ID)) {
                $this->Attachments()->add($attachment);
            }
        }

        // Remove old attachments that are currently assigned to this article,
        // but have not been returned this time around
        if ($idList) {
            $this->Attachments()->exclude('HailID', $idList)->removeAll();
        } else {
            // If there's no attachements, just remove everything.
            $this->Attachments()->removeAll();
        }
    }
1242834
public function setData($data)
	{
		if( is_null($data) )
		{
			$data = new stdClass();
		}

		if( $data instanceof stdClass )
		{
			$this->data = $data;
		}
		else
		{
			$this->data = (object) $data;
		}
		
		$this->id = $this->data->{$this->idKey};
		$this->type = $this->data->{$this->typeKey};

		$dataVars = get_object_vars($this->data);
		foreach ($this->guarded as $guardedProperty)
		{
			if( array_key_exists($guardedProperty, $dataVars) )
			{
				$this->protected[$guardedProperty] = $this->data->$guardedProperty;
				unset($this->data->$guardedProperty);
			}
		}
	}