Convert to an array of database properties.

@param bool $bIncludeExtras Should tags & "repeats" be included?
@return array
426548
public function toArray(bool $bIncludeExtras = true)
    {
        // Sanitize
        $this->adjustDependentFields();

        $aReturn = array_filter($this->aProperties, function($mValue, $strKey) {
            return !empty($mValue) && '-' !== $mValue && (
                in_array($strKey, ['created_at', 'updated_at'])
                || in_array($strKey, self::WEEKDAYS)
                || array_key_exists($strKey, Sked::form()->getFieldDefinitions())
            );
        }, ARRAY_FILTER_USE_BOTH);
        if (isset($aReturn['starts_at']))
            $aReturn['starts_at'] = date('Y-m-d H:i:s', strtotime($aReturn['starts_at']));
        if (isset($aReturn['ends_at']))
            $aReturn['ends_at'] = date('Y-m-d H:i:s', strtotime($aReturn['ends_at']));

        // Include tags?
        if ($bIncludeExtras) {
            $aReturn['tags'] = $this->getTags();
            $aReturn['repeats'] = self::INTERVAL_ONCE !== $aReturn['interval'] ? '1' : null;
        } else {
            unset($aReturn['repeats']);
        }

        return $aReturn;
    }
231949
public function __toArray($resolveDBRefs = true) {
		// Get model data
		$data = array();
		foreach ( array_keys( $this->__data ) as $key ):
			// Get data for key
			$data[$key] = $this->__get($key);

			// Resolve DB references
			if ( $resolveDBRefs && $data[$key] instanceof \Mongoium\Document ):
				$data[$key] = $data[$key]->__toArray();
			elseif ( $data[$key] instanceof \Mongoium\Document ):
				$data[$key] = $data[$key]->__toString();
			endif;
		endforeach;

		// Return data
		return $data;
	}
371995
public function getTableName($bIncludeAlias = false): string
    {
        $sTable = parent::getTableName() . static::$sLocalisedTableSuffix;
        return $bIncludeAlias ? trim($sTable . ' as `' . $this->getTableAlias() . '`') : $sTable;
    }
583503
public function getEmbeddableProperties(): array
    {
        if (null !== $this->embeddableProperties) {
            return $this->embeddableProperties;
        }
        $traits = $this->reflectionClass->getTraits();
        $return = [];
        foreach ($traits as $traitName => $traitReflection) {
            if (\ts\stringContains($traitName, '\\Entity\\Embeddable\\Traits')) {
                $property                     = $traitReflection->getProperties()[0]->getName();
                $embeddableObjectInterfaceFqn = $this->getTypesFromVarComment(
                    $property,
                    $this->getReflectionHelper()->getTraitProvidingProperty($traitReflection, $property)
                )[0];
                $embeddableObject             = $this->getNamespaceHelper()
                                                     ->getEmbeddableObjectFqnFromEmbeddableObjectInterfaceFqn(
                                                         $embeddableObjectInterfaceFqn
                                                     );
                $return[$property]            = $embeddableObject;
            }
        }

        return $return;
    }
1346751
public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) 
    {
        String strType = (String)properties.get(DBSQLTypes.SHORT);
        if (strType == null)
            strType = DBSQLTypes.SMALLINT;      // The default SQL Type (Byte)
        return  strType;        // The default SQL Type
    }
822609
public function diff($arExcludeIDList = [])
    {
        if (empty($arExcludeIDList) || $this->isEmpty()) {
            return $this->returnThis();
        }

        $this->arElementIDList = array_diff($this->arElementIDList, $arExcludeIDList);

        return $this->returnThis();
    }
811345
public function getVariantIds($blActiveVariants = true)
    {
        $aSelect = [];
        $sId = $this->getId();
        if ($sId) {
            $sActiveSqlSnippet = "";
            if ($blActiveVariants) {
                $sActiveSqlSnippet = " and " . $this->getSqlActiveSnippet(true);
            }
            $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);
            $sQ = "select oxid from " . $this->getViewName(true) . " where oxparentid = " . $oDb->quote($sId) .
                  $sActiveSqlSnippet . " order by oxsort";
            $oRs = $oDb->select($sQ);
            if ($oRs != false && $oRs->count() > 0) {
                while (!$oRs->EOF) {
                    $aSelect[] = reset($oRs->fields);
                    $oRs->fetchRow();
                }
            }
        }

        return $aSelect;
    }
370634
function GetPropertyTypes() {
		$response = $this->MakeAPICall("GET", "propertytypes", '24h');

		if ($response['success'] == true) {
			$records = array();
			foreach ($response['results'] as $res) {
				$records[$res['MlsCode']] = $res['MlsName'];
			}

			return $records;
		}
		else {
			return false;
		}
	}
1194684
protected function getBinaryFileFields(array $collectedFields)
    {
        $filtered = [];
        foreach ($collectedFields as $identifier => $value) {
            if ($value instanceof BinaryFile) {
                $filtered[] = $value;
            }
        }

        return empty($filtered) ? null : $filtered;
    }
476640
public String getSQLType(boolean bIncludeLength, Map<String, Object> properties) 
    {
        String strType = (String)properties.get(DBSQLTypes.FLOAT);
        if (strType == null)
            strType = DBSQLTypes.FLOAT;     // The default SQL Type (Byte)
        return  strType;        // The default SQL Type
    }
410092
public function getExtendedFields()
    {
        $result = [];
        $fields = $this->getEntities(
            [
                'filter'         => [
                    'where' => [
                        [
                            'expr' => 'orX',
                            'val'  => [
                                ['column' => 'f.object', 'expr' => 'eq', 'value' => 'extendedField'],
                                ['column' => 'f.object', 'expr' => 'eq', 'value' => 'extendedFieldSecure'],
                            ],
                        ],
                    ],
                ],
                'hydration_mode' => 'HYDRATE_ARRAY',
            ]
        );
        foreach ($fields as $field) {
            $result[$field['alias']] = $field;
        }

        return $result;
    }
883746
protected function allFieldsFromDataObject($includeHasOne = false)
    {
        $fields = [];
        $db = DataObject::config()->get('fixed_fields');
        $extra = Config::inst()->get($this->getDataObjectClass(), 'db');
        if ($extra) {
            $db = array_merge($db, $extra);
        }

        foreach ($db as $fieldName => $type) {
            $fields[] = $fieldName;
        }

        if ($includeHasOne) {
            $hasOne = $this->getDataObjectInstance()->hasOne();
            foreach ($hasOne as $fieldName => $class) {
                $fields[] = $fieldName;
            }
        }

        return $fields;
    }
1057151
protected function getExcludedTables()
	{
		$excludes = ['migrations'];
		$ignore = $this->option('ignore');
		if ( ! empty($ignore)) {
			return array_merge($excludes, explode(',', $ignore));
		}

		return $excludes;
	}
1294882
public function getFields($blnIncludeMultiFields = false)
    {
        $objFields = new Collection();

        foreach ($this->__elements as $objPage) {
            if ($objPage->hasFields()) {
                foreach ($objPage->getFields() as $objFieldset) {
                    if ($objFieldset->hasFields()) {
                        foreach ($objFieldset->getFields() as $objField) {
                            if (is_object($objField)) {
                                if ($objField->hasFields()) {
                                    // Also add the multifield to the resulting collection, if $blnIncludeMultiFields is true.
                                    if (get_class($objField) == "ValidFormBuilder\\MultiField" && $blnIncludeMultiFields) {
                                        $objFields->addObject($objField);
                                    }

                                    foreach ($objField->getFields() as $objSubField) {
                                        if (is_object($objSubField)) {
                                            if ($objSubField->hasFields()) {
                                                // Also add the multifield to the resulting collection, if $blnIncludeMultiFields is true.
                                                if (get_class($objField) == "ValidFormBuilder\\MultiField" && $blnIncludeMultiFields) {
                                                    $objFields->addObject($objField);
                                                }

                                                foreach ($objSubField->getFields() as $objSubSubField) {
                                                    if (is_object($objSubSubField)) {
                                                        $objFields->addObject($objSubSubField);
                                                    }
                                                }
                                            } else {
                                                $objFields->addObject($objSubField);
                                            }
                                        }
                                    }
                                } else {
                                    $objFields->addObject($objField);
                                }
                            }
                        }
                    } else {
                        $objFields->addObject($objFieldset);
                    }
                }
            } else {
                $objFields->addObject($objPage);
            }
        }

        return $objFields;
    }
1131262
public function listContainers($include_properties = false)
    {
        $this->checkConnection();

        if (!empty($this->container)) {
            return $this->listResource($include_properties);
        }

        /** @var \MicrosoftAzure\Storage\Blob\Models\ListContainersResult $result */
        $result = $this->blobConn->listContainers();

        /** @var \MicrosoftAzure\Storage\Blob\Models\Container[] $items */
        $items = $result->getContainers();
        $result = [];
        foreach ($items as $item) {
            $name = $item->getName();
            $out = ['name' => $name, 'path' => $name];
            if ($include_properties) {
                $props = $item->getProperties();
                $out['last_modified'] = gmdate(static::TIMESTAMP_FORMAT, $props->getLastModified()->getTimestamp());
            }
            $result[] = $out;
        }

        return $result;
    }
1321022
protected function applyExcludes(array $dataTypes): array
    {
        $exclusions = explode(',', $this->exclude);
        // Find any invalid data to exclude.
        $invalidExcludes = array_diff($exclusions, $dataTypes);
        if (count($invalidExcludes) > 0) {
            $errorMessage = 'WARNING: Invalid exlude(s)';
            $errorMessage .= ': '.implode(', ', $invalidExcludes).'.'.PHP_EOL;
            $errorMessage .= ' Valid exclusions are '.implode(', ', $dataTypes);

            // Output an error message outlining what invalid exclusions were specified.
            Schematic::warning($errorMessage);
        }
        // Remove any explicitly excluded data types from the list of data types to export.
        return array_diff($dataTypes, $exclusions);
    }
148664
private function buildPageExclude()
    {
        $idsWhere = [];
        foreach ($this->excluded as $id) {
            $idsWhere[] = sprintf("(NOT page.[jcr:uuid] = '%s')", $id);
        }

        return $idsWhere;
    }