@param MapField         $field
@param ElementInterface $owner

@throws \Throwable
184129
public function softDeleteField (MapField $field, ElementInterface $owner)
	{
		/** @var MapElement $map */
		$map = $owner->getFieldValue($field->handle);

		\Craft::$app->getElements()->deleteElement($map);
	}
90618
public function chown(string $file, string $owner = null, bool $recursive = false) : void
    {
        if ($owner === null) {
            $owner = $this->getUser();
        }

        $this->call('update_chown', [
            'chown_path' => $file,
            'chown_user' => $owner,
            'recursive' => $recursive ? 'Y' : 'N',
        ]);
    }
1226284
public function map($field, $context = null)
    {
        foreach ($this->mappers as $mapper) {
            $field = $mapper->map($field, $context);
        }
        return $field;
    }
1101045
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null) if (m_fldToDisable != null)
            if (this.getOwner().getRecord() != m_fldToDisable.getRecord())
                m_fldToDisable.addListener(new FieldRemoveBOnCloseHandler(this)); // Make sure you remove this listener if m_fldToDisable is gone.
        if (owner != null)
            if (m_fldToDisable == null)
                m_fldToDisable = this.getOwner();
        if (owner != null)
            this.fieldChanged(DBConstants.DONT_DISPLAY, DBConstants.INIT_MOVE);
        if (owner == null)
            m_fldToDisable.setEnabled(true);    // Remove the behavior = reenable the field
    }
816822
private function process(MapperInterface $mapper, Connection $connection, Node $cursor, $field = null, $type = null)
    {
        while ($result = $connection->executeFragment($cursor)) {
            if (pg_num_rows($result) === 0) {
                break;
            }

            while ($value = pg_fetch_assoc($result)) {
                $value = json_decode($value['json'], true);

                if ($field !== null) {
                    $value = $value[$field];
                }

                if ($type !== null) {
                    $value = $mapper->fromPg($value, $type);
                }

                yield $value;
            }

            pg_free_result($result);
        }

        pg_free_result($result);
    }
1033918
public function attach($owner) {
		parent::attach($owner);
		if ($this->name === null) {
			throw new InvalidConfigException("No name specified for ".get_class($this));
		}
		if (method_exists($owner, "getPrimaryKey")) {
			$this->_oldName = $this->name;

			$pk = $owner->getPrimaryKey();
			if (is_array($pk)) {
				foreach($pk as $key => $value) {
					$pk[$key] = $key.":".$value;
				}
				$pk = implode(":",$pk);
			}
			$this->name = get_class($owner).":".$pk.":".$this->name;
		}
	}
865129
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() == null)
            return;
        if (m_recordSub != null)    // If field is not in this file, remember to remove it
            m_recordSub.addListener(new FileRemoveBOnCloseHandler(this));
    }
171243
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner == null)
            return;
        if (m_fldThisFile == null)
            if (thisFileFieldName != null)
                m_fldThisFile = this.getOwner().getField(thisFileFieldName);
        if (m_fldThisFile2 == null)
            if (thisFileFieldName2 != null)
                m_fldThisFile2 = this.getOwner().getField(thisFileFieldName2);
        if (m_fldThisFile3 == null)
            if (thisFileFieldName3 != null)
                m_fldThisFile3 = this.getOwner().getField(thisFileFieldName3);
//?        if (m_fldThisFile != null)
//?            m_fldThisFile.saveEnableListeners(false);     // Don't let behaviors mess with my values.
//?        if (m_fldThisFile2 != null)
//?            m_fldThisFile2.saveEnableListeners(false);    // Note: This is because of a conflict with.
//?        if (m_fldThisFile3 != null)
//?            m_fldThisFile3.saveEnableListeners(false);    // InitOnceFieldHandler, the value is only set once.
//x        this.setMainKey(true, null);    // Initialize the keys
    }
1021270
public function validateField (MapField $field, ElementInterface $owner)
	{
		/** @var MapElement $map */
		$map = $owner->getFieldValue($field->handle);

		$valid = $map->validate();

		foreach ($map->getErrors() as $error)
			$owner->addError($field->handle, $error[0]);

		return $valid;
	}
158679
public function mapField(array $mapping)
    {
        $mapping = parent::mapField($mapping);

        if ($this->reflClass->hasProperty($mapping['fieldName'])) {
            $reflProp = $this->reflClass->getProperty($mapping['fieldName']);
            $reflProp->setAccessible(true);
            $this->reflFields[$mapping['fieldName']] = $reflProp;
        }
    }
211603
public function mapFromObjectToField($data, FieldTypeInterface $field)
    {
        if (! is_object($data)) {
            $this->triggerException();
        }

        $field->setValue(
            $this->propertyAccessor->getValue($data, $field->getBaseName())
        );
    }
563969
public void putField(Type owner, String name, Type type) {
    adapter.putField(owner, name, type);
  }
1278258
public function setOwner(\WobbleCode\UserBundle\Document\User $owner)
    {
        $this->owner = $owner;
        return $this;
    }
169604
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (owner != null)
        {
            BaseField field = m_field;
            if (field != null)
                if (field.getRecord() != owner)
            {   // Points to different file... make sure this is removed if the other file is closed
                field.addListener(new FieldRemoveBOnCloseHandler(this));
            }
        }
    }
335933
public void setOwner(ListenerOwner owner)
    {
        super.setOwner(owner);
        if (this.getOwner() != null)
            this.syncBehaviorToRecord(this.getOwner().getRecord().getField(m_iMainFilesFieldSeq));  // Init now
    }
148393
@SuppressWarnings("unchecked")
    private static void setMapParam(Field field, List<?> values) {
        try {
            // Find Map method: put(Object, Object)
            Class<?> fieldClass = field.getType();
            Method addMethod = fieldClass.getMethod("put", Object.class, Object.class);
            
            // Add each map key/value to field value
            for (Object subParam : values) {
                if (subParam instanceof Map) {
                    Map<String, ?> map = (Map<String, ?>)subParam;
                    for (String key : map.keySet()) {
                        Object value = map.get(key);
                        if (value instanceof List) {
                            // Contains a single element, which is a key/value map
                            value = ((List<?>)value).get(0);
                        }
                        addMethod.invoke(field.get(config), key, value);
                    }
                } else {
                    throw new RuntimeException("Unexpected collection parameter type for '" + field.getName() + ":" + subParam);
                }
            }
        } catch (NoSuchMethodException  | IllegalArgumentException | InvocationTargetException | IllegalAccessException e) {
            throw new RuntimeException("Error setting configuration parameter '" + field.getName() + "'", e);
        }
    }
63385
public void setOwner(ListenerOwner owner)
    {
        if (owner == null)
        {
            if (m_messageListener != null)
            {
                m_messageListener.free();
                m_messageListener = null;
            }
        }
        super.setOwner(owner);
        if (owner != null)
        {
            Record record = this.getOwner().getRecord();
            MessageManager messageManager = ((Application)record.getTask().getApplication()).getMessageManager();
            if (messageManager != null)
            {
                BaseMessageFilter messageFilter = new BaseMessageFilter(MessageConstants.TRX_RETURN_QUEUE, MessageConstants.INTERNET_QUEUE, this, null);
                messageManager.addMessageFilter(messageFilter);
                m_messageListener = new  WaitForFieldChangeMessageListener(messageFilter, this);
                record.setupRecordListener(m_messageListener, false, false);   // I need to listen for record changes
            }
        }            
    }