/** * @return void * @throws \obo\Exceptions\Exception */ public function createCache() { $entitiesList = []; $fp = \fopen($this->lockFilePath, "c+"); if (!\flock($fp, LOCK_EX)) { throw new \obo\Exceptions\Exception("Unable to acquire exclusive lock"); } foreach ($this->explorer->analyze($this->modelsDirs) as $className => $entityInformation) { $this->cache->store($className, $entityInformation); $entitiesList[] = $className; } $this->cache->store("entitiesList", $entitiesList); $this->cache->store("changesHash", $this->calculateChangesHash()); $this->cacheValidity = true; \flock($fp, \LOCK_UN); \fclose($fp); @\unlink($this->lockFilePath); }
/** * @param \obo\Services\EntitiesInformation\Explorer $entitiesExplorer * @return void */ public static function register(\obo\Services\EntitiesInformation\Explorer $entitiesExplorer) { $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Entity\\Name"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Entity\\Description"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Entity\\PrimaryProperty"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Entity\\RepositoryName"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Entity\\SoftDeletable"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Method\\Run"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\Caption"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\ColumnName"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\Persistable"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\Many"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\One"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\TimeStamp"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\DataType"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\StoreTo"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\Uuid"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\AutoIncrement"); $entitiesExplorer->registerAnnotation("\\obo\\Annotation\\Property\\Nullable"); }
public static function register(\obo\Services\EntitiesInformation\Explorer $entitiesExplorer) { $entitiesExplorer->registerDatatype("\\obo\\DataType\\ArrayDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\BooleanDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\DateTimeDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\EntityDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\FloatDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\IntegerDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\MixedDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\NumberDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\ObjectDataType"); $entitiesExplorer->registerDatatype("\\obo\\DataType\\StringDataType"); }