@param object $entry

@return ORMInvalidArgumentException
188825
public static function detachedEntityFoundThroughRelationship(AssociationMetadata $association, $entry)
    {
        $messsage = "A detached entity of type %s (%s) was found through the relationship '%s#%s' during cascading a persist operation.";

        return new self(sprintf(
            $messsage,
            $association->getTargetEntity(),
            self::objToStr($entry),
            $association->getSourceEntity(),
            $association->getName()
        ));
    }
1259978
public function addEntry($entry)
	{
		// Set some default field values if not already set.
		$date = new AnDate();

		if (!isset ($entry['date'])) {
			$entry['date'] = $date->format("%Y-%m-%d");
		}

		if (!isset ($entry['time'])) {
			$entry['time'] = $date->format("%H:%M:%S");
		}

		if (!isset ($entry['c-ip'])) {
			$entry['c-ip'] = $_SERVER['REMOTE_ADDR'];
		}

		// Ensure that the log entry keys are all uppercase
		$entry = array_change_key_case($entry, CASE_UPPER);

		// Find all fields in the format string
		$fields = array ();
		$regex = "/{(.*?)}/i";
		preg_match_all($regex, $this->_format, $fields);

		// Fill in the field data
		$line = $this->_format;

		for ($i = 0; $i < count($fields[0]); $i++) {
			$line = str_replace($fields[0][$i], (isset ($entry[$fields[1][$i]])) ? $entry[$fields[1][$i]] : "-", $line);
		}

		// Write the log entry line
		if ($this->_openLog()) {
            return fputs($this->_file, "\n" . $line) ? true : false;
		}

        return false;
	}
497333
public function deleteEntry($Entry)
    {
        if ($this->Using === 'APCu') {
            if (apcu_delete($Entry)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'Memcached' || $this->Using === 'Redis') {
            if ($this->WorkingData->delete($Entry)) {
                return $this->Modified = true;
            }
            return false;
        }
        if ($this->Using === 'PDO') {
            $PDO = $this->WorkingData->prepare(self::deleteQuery);
            if ($PDO !== false && $PDO->execute(['key' => $Entry])) {
                return ($PDO->rowCount() > 0 && $this->Modified = true);
            }
            return false;
        }
        if (is_array($this->WorkingData)) {
            if (isset($this->WorkingData[$Entry])) {
                unset($this->WorkingData[$Entry]);
                return $this->Modified = true;
            }
        }
        return false;
    }
218697
public function nestedValidate($value) : NestableResult
    {
        $outer = parent::validateSimple($value);

        // Fatal error => no inner validation.
        $schema = $outer->isFatal() ? [] : $this->schema;
        $values = [];

        // Regrettably, as neat as I could get it...
        foreach ($schema as $key => $validator) {
            if (!isset($value[$key])) {
                $values[$key] = Result::failure('missing key');

                if ($validator instanceof NestableAbstract) {
                    $values[$key] = NestableResult::lift($values[$key]);
                }
            } else {
                $values[$key] = $validator instanceof NestableAbstract
                    ? $validator->nestedValidate($value[$key])
                    : $validator->validate($value[$key]);
            }
        }

        return new NestableResult($outer, $values);
    }
1209659
public function validate($value)
    {
        $value = filter_var($value, FILTER_VALIDATE_EMAIL);
        if (false === $value) {
            throw FailedToValidate::fromValueForClass($value, static::class);
        }
        return $value;
    }
721469
public function format($mask, Entry $entry)
    {
        return $this->formatter->format($mask, function ($key) use ($entry) {
            if ($key === 'id') {
                return $entry->getID();
            }
            
            $attribute = $entry->getAttribute($key);
            if ($attribute) {
                return $attribute;
            }

            $association = $entry->getAssociation($key);
            if (is_object($association)) {
                return $association->getSelectedEntry()->getLabel();
            }
        });
    }
327255
private function addAccumulativeEntry(
        EntryInterface $entry,
        $entryKey
    ) {
        $this->doRedisQuery(function () use ($entry, $entryKey) {
            $this
                ->redis
                ->incrby(
                    $entryKey . '_accum',
                    (int) $entry->getValue()
                );
        });

        return $this;
    }
603295
protected function _createItem( array $entry )
	{
		$item = $this->_manager->createItem();

		foreach( $entry as $name => $value )
		{
			switch( $name )
			{
				case 'product.tag.id': $item->setId( $value ); break;
				case 'product.tag.label': $item->setLabel( $value ); break;
				case 'product.tag.typeid': $item->setTypeId( $value ); break;
				case 'product.tag.languageid':
					if( $value != '' ) {
						$item->setLanguageId( $value );
					}
					break;
			}
		}

		return $item;
	}
749493
public function add(array $entry)
    {
        if (!isset($entry['msgid'])) {
            throw new Exception("Invalid entry: missing msgid");
        }
        $id = $entry['msgid'];
        $plural_id = isset($entry['msgid_plural']) ? $entry['msgid_plural'] : null;
        $context = isset($entry['msgctxt']) ? $entry['msgctxt'] : null;
        $flags = isset($entry['flags']) ? $entry['flags'] : array();

        $strings = array();
        foreach ($entry as $key => $value) {
            if (substr($key, 0, 6) === 'msgstr') {
                if (is_array($value)) {
                    $strings = array_merge($strings, $value);
                } else {
                    $strings[] = $value;
                }
            }
        }
        if (count($strings) === 0) {
            throw new Exception("Invalid entry: missing msgstr");
        }
        $this->set[] = array(
            'id' => $id,
            'plural' => $plural_id,
            'context' => $context,
            'flags' => $flags,
            'strings' => $strings
        );
    }
816551
protected function castLoadedEntry(array $entry)
    {
        $entry['valid_until'] = (int)$entry['valid_until'];
        $entry['outside'] = (int)$entry['outside'];
        $entry['plain'] = (int)$entry['plain'];

        if ((bool)$entry['outside']) {
            return $entry;
        }

        if (!(bool)$entry['plain']) {
            $entry['payload'] = $this->serializer->deserialize($entry['payload']);
            $entry['plain'] = 1;
        }

        return $entry;
    }
156575
public static function logEntry($entry)
  {
    $parts = explode("|", $entry, 5);
    $array = array();

    if(count($parts) != 5)
    {
      $array["timestamp"] = 0;
      $array["level"]     = TeamSpeak3::LOGLEVEL_ERROR;
      $array["channel"]   = "ParamParser";
      $array["server_id"] = "";
      $array["msg"]       = Str::factory("convert error (" . trim($entry) . ")");
      $array["msg_plain"] = $entry;
      $array["malformed"] = TRUE;
    }
    else
    {
      $array["timestamp"] = strtotime(trim($parts[0]));
      $array["level"]     = self::logLevel(trim($parts[1]));
      $array["channel"]   = trim($parts[2]);
      $array["server_id"] = trim($parts[3]);
      $array["msg"]       = Str::factory(trim($parts[4]));
      $array["msg_plain"] = $entry;
      $array["malformed"] = FALSE;
    }

    return $array;
  }
671604
public function remove($entry)
    {
        $result = $this->zip->deleteName($entry);
        if ($result === false) {
            throw new ArchiveException('Error removing entry ' . $entry);
        }

        return $this;
    }
840041
public function validator($resource=null)
    {

        $resource = $this->passedOrCurrent($resource);

        if ($class = $this->mapper->validatorClass($resource)) {
            return $this->makeValidator($resource, $class);
        }

        $modelClass = class_basename($this->modelClass($resource));

        if ($class = $this->finder->validatorClass($resource, $modelClass)) {
            return $this->makeValidator($resource, $class);;
        }

        $class = 'Cmsable\Resource\GenericResourceValidator';

        if ($rules = $this->getManualRules($resource)) {
            $validator = $this->makeValidator($resource, $class);
            return $validator->setRules($rules);
        }

        // Support for rules inside forms
        if (!$this->hasForm($resource)) {
            throw new RuntimeException('No validator for resource $resource found');
        }


        if ($rules = $this->formRules($this->form(null, $resource))) {
             $validator = $this->makeValidator($resource, $class);
             return $validator->setRules($rules);

        }

        throw new RuntimeException('No validator for resource $resource found');

    }
1062979
public static function storeEntry(Entry $entry): DbEntry
    {
        $dbEntry = new static;
        $dbEntry->channel = $entry->channel();
        $dbEntry->level = $entry->level();
        $dbEntry->message = $entry->message();
        $dbEntry->context = $entry->context();
        $dbEntry->save();
        return $dbEntry;
    }
250018
public static function create(Entry $entry, Locale $locale)
    {
        $result = new static();
        $result->entry = $entry;
        $result->locale = $locale;
        $result->comments = '';

        return $result;
    }
392597
public function setEntry(Entry $entry)
    {
        $entry->setScriptEvents(true)
              ->checkId();
        $this->entry = $entry;
        return $this;
    }
160908
public function isReadOnly($object)
    {
        if ( ! is_object($object)) {
            throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
        }

        return isset($this->readOnlyObjects[spl_object_hash($object)]);
    }