Check whether record of this object is deletable based on inverse foreign-key list.

@return	bool
512948
public function isDeletable() {
		
		$inverseForeignKeys = $this->db->getInverseForeignKeys(static::TABLE_NAME);
		
		foreach ($inverseForeignKeys as $r) {
			
			// only if restrict it could be not deletable
			if ('RESTRICT' != $r->DELETE_RULE) continue;
			
			// get the property name
			$propertyName = $this->getMappedProperty($r->REFERENCED_COLUMN_NAME);
			
			return !$this->checkRecordExists($r->TABLE_NAME, $r->COLUMN_NAME, $this->$propertyName);
			
		}
		
		// nothing found, is deletable
		return TRUE;
		
	}
140102
public function hasScalarKeys() {
    if ($this->key instanceof ScalarNode) {
      return $this->array instanceof ArrayLookupNode ? $this->array->hasScalarKeys() : TRUE;
    }
    else {
      return FALSE;
    }
  }
630219
protected function isEditable()
    {
        return
            $this->editable
            &&
            ! $this->isTrashed()
            &&
            $this->getModelConfiguration()->isEditable(
                $this->getModel()
            );
    }
115729
final public function isDeleted()
    {
        $column = static::SOFT_DELETE;
        if ($column) {
            $value = $this->__get($column);
            switch (static::SOFT_DELETE_MODE) {
                case 'deleted':
                    $result = (int) $value === 1;
                    break;

                case 'active':
                    $result = (int) $value === 0;
                    break;

                case 'stamp':
                    $result = $value !== null;
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s has invalid SOFT_DELETE_MODE mode: '%s'",
                        static::class,
                        static::SOFT_DELETE_MODE
                    ));
                    break;
            }
            return $result;
        }
        return false;
    }
1075155
protected function canDeleteField()
    {
        return isset($this->data_field['field_id'])
            && $this->field->canDelete($this->data_field['field_id'])
            && $this->access('field_delete');
    }
1280454
protected function isDestroyable()
    {
        return
            $this->destroyable
            &&
            $this->isTrashed()
            &&
            $this->getModelConfiguration()->isDestroyable(
                $this->getModel()
            );
    }
712617
public function isRecordOriginModifiable()
    {
        $retVal = false;
        if ($this->isRecordOriginFlagSet()) {
            $retVal = $this->def->getService()->getRecordOriginModifiable();
        }

        return $retVal;
    }
1278558
public function isObjResettable()
    {
        if ($this->isObjResettable === null) {
            // Overridden by permissions
            if (!$this->checkPermission('reset') || !$this->form()) {
                $this->isObjResettable = false;
            } else {
                $this->isObjResettable = true;

                $obj    = $this->form()->obj();
                $method = [ $obj, 'isResettable' ];
                if (is_callable($method)) {
                    $this->isObjResettable = call_user_func($method);
                }
            }
        }

        return $this->isObjResettable;
    }
492252
protected function canDeleteUser()
    {
        return isset($this->data_user['user_id'])
            && $this->access('user_delete')
            && $this->user->canDelete($this->data_user['user_id']);
    }
811102
private function isSkipTable(): bool
    {
        $config = (array)Configure::read('RolesCapabilities.ownerCheck.skipTables.byInstance');
        if (in_array(get_class($this->table), $config)) {
            return true;
        }

        $config = (array)Configure::read('RolesCapabilities.ownerCheck.skipTables.byRegistryAlias');
        if (in_array($this->table->getRegistryAlias(), $config)) {
            return true;
        }

        $config = (array)Configure::read('RolesCapabilities.ownerCheck.skipTables.byTableName');
        if (in_array($this->table->getTable(), $config)) {
            return true;
        }

        return false;
    }
224746
public function canEdit(): bool
    {
        if ($this->isPendingDeletion()) {
            return false;
        }

        if (Auth::isManager($this->record->tree())) {
            return true;
        }

        // Members cannot edit RESN, CHAN and locked records
        return Auth::isEditor($this->record->tree()) && strpos($this->gedcom, "\n2 RESN locked") === false && $this->getTag() !== 'RESN' && $this->getTag() !== 'CHAN';
    }
473853
public function isSaveable()
    {
        return !$this->showOnClick
            || ($this->showOnClick && $this->hiddenField && $this->hiddenField->Value());
    }
534809
public function hasPrimaryKey()
    {
        $empty = true;

        foreach ($this->keys as $key) {
            $empty = $empty && !$this->$key;
        }

        return !$empty;
    }
225025
public function isMySqlAvailable() {
    if (is_null($this->isMySqlAvailable)) {
      $this->isMySqlAvailable = $this->getMySqlAvailable();
    }

    return $this->isMySqlAvailable;
  }
1058413
public function isArchivable()
    {
        if (is_null($this->_isArchivable)) {
            $this->_isArchivable = true;
            $ownerClass = get_class($this->owner);
            $schema = $ownerClass::getTableSchema();

            if (!isset($schema->columns[$this->archiveField])) {
                $this->_isArchivable = false;
            }
        }

        return $this->_isArchivable;
    }
101538
public function isEnable()
    {
        if (!$this->mPDFExists() || !$this->collection()->getSize()) {
            return false;
        }

        return $this->hasConfig(self::ENABLE);
    }
569072
public function delete()
    {
        if ($this->getPk() === null) {
            return false;
        }
        $query = $this->_queryClass;
        $bindKey = PdoBindHelper::generateBindKey();
        $result = DbConnector::getAdapter()->delete((new $query)->getTableName(), $this->_pkWhere($bindKey), [$bindKey => $this->getInitialStateValue('id')]);
        return ($result > 0) ? true : false;
    }