コード例 #1
0
 private function insertProperty(Property $property, $packageVersionId)
 {
     $this->propertyStmt->bindValue(1, $property->getName());
     $this->propertyStmt->bindValue(2, $property->getVisibility(), \PDO::PARAM_INT);
     $this->propertyStmt->bindValue(3, $this->phpType->convertToDatabaseValue($property->getPhpType(), $this->platform));
     $this->propertyStmt->bindValue(4, $packageVersionId, \PDO::PARAM_INT);
     $this->propertyStmt->execute();
     $propertyId = $this->con->lastInsertId();
     $this->propertyIdRef->setValue($property, $propertyId);
     return $propertyId;
 }
コード例 #2
0
 private function inferTypesForProperty(Property $property)
 {
     if (($type = $property->getPhpType()) && !$type->isUnknownType()) {
         return;
     }
     if (null !== ($node = $property->getAstNode())) {
         if ($property instanceof \PHPParser_Node_Stmt_Class) {
             $type = $this->parser->getTypeFromMagicPropertyAnnotation($node, $property->getName());
         } else {
             $type = $this->parser->getTypeFromVarAnnotation($node);
         }
     }
     if (null === $type) {
         $type = $this->registry->getNativeType('unknown');
     }
     $property->setPhpType($type);
     if ($node) {
         $node->setAttribute('type', $type);
     }
 }